Mismatch of task method and queue mode. e.g. Queue#leaseTasks(long,
java.util.concurrent.TimeUnit, long) called on a push queue, Queue#add(TaskOptions) with
method TaskOptions.Method PULL to a push queue, or with TaskOptions.Method not
equal to PULL to a pull queue.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003e\u003ccode\u003eInvalidQueueModeException\u003c/code\u003e is a runtime exception triggered by a mismatch between the task method and the queue mode.\u003c/p\u003e\n"],["\u003cp\u003eThis exception occurs when operations like \u003ccode\u003eQueue#leaseTasks\u003c/code\u003e are used on a push queue, or when \u003ccode\u003eQueue#add\u003c/code\u003e is used with \u003ccode\u003eTaskOptions.Method\u003c/code\u003e PULL on a push queue.\u003c/p\u003e\n"],["\u003cp\u003eThis exception also occurs when the \u003ccode\u003eTaskOptions.Method\u003c/code\u003e is not set to PULL when being performed on a pull queue.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eInvalidQueueModeException\u003c/code\u003e constructor takes a string parameter \u003ccode\u003edetail\u003c/code\u003e for providing a detailed description of the exception.\u003c/p\u003e\n"],["\u003cp\u003eThis exception inherits various methods from \u003ccode\u003eObject\u003c/code\u003e and \u003ccode\u003eThrowable\u003c/code\u003e classes, including methods for stack trace manipulation and basic object operations.\u003c/p\u003e\n"]]],[],null,["# Exception InvalidQueueModeException (2.0.0)\n\n public class InvalidQueueModeException extends RuntimeException\n\nMismatch of task method and queue mode. e.g. Queue#leaseTasks(long, java.util.concurrent.TimeUnit, long) called on a push queue, [Queue#add(TaskOptions)](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.Queue#com_google_appengine_api_taskqueue_Queue_add_com_google_appengine_api_taskqueue_TaskOptions_) with\nmethod [TaskOptions.Method](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.TaskOptions.Method) PULL to a push queue, or with [TaskOptions.Method](/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.taskqueue.TaskOptions.Method) not\nequal to PULL to a pull queue. \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-) \n[Throwable.addSuppressed(Throwable)](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#addSuppressed-java.lang.Throwable-) \n[Throwable.fillInStackTrace()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#fillInStackTrace--) \n[Throwable.getCause()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getCause--) \n[Throwable.getLocalizedMessage()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getLocalizedMessage--) \n[Throwable.getMessage()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getMessage--) \n[Throwable.getStackTrace()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getStackTrace--) \n[Throwable.getSuppressed()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#getSuppressed--) \n[Throwable.initCause(Throwable)](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#initCause-java.lang.Throwable-) \n[Throwable.printStackTrace()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace--) \n[Throwable.printStackTrace(PrintStream)](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintStream-) \n[Throwable.printStackTrace(PrintWriter)](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#printStackTrace-java.io.PrintWriter-) \n[Throwable.setStackTrace(StackTraceElement\\[\\])](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#setStackTrace-java.lang.StackTraceElement[]-) \n[Throwable.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html#toString--)\n\nConstructors\n------------\n\n### InvalidQueueModeException(String detail)\n\n public InvalidQueueModeException(String detail)"]]