When trying to implement a push queue, I am getting the following error:
com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call taskqueue.BulkAdd in a thread that is neither the original request thread nor a thread created by ThreadManager
Within my servlet's doPost()
method, here is my task:
Queue queue = QueueFactory.getQueue("rating-queue");
queue.add(TaskOptions.Builder.withUrl("/addrating")
.param("function", function)
.param("user_id", Integer.toString(user_id))
.param("item_id", Integer.toString(item_id))
.param("is_user", Boolean.toString(isUser)));
In my web.xml
file:
<servlet>
<servlet-name>AddRating</servlet-name>
<servlet-class>com.example.ExampleClass</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AddRating</servlet-name>
<url-pattern>/addrating</url-pattern>
</servlet-mapping>
Here is my queue.xml file in my WEB-INF folder:
<queue-entries>
<queue>
<name>default</name>
<rate>5/s</rate>
</queue>
<queue>
<name>rating-queue</name>
<rate>5/s</rate>
</queue>
</queue-entries>
I'm running my servlet locally. There are no task queues visible in my app engine console.
来源:https://stackoverflow.com/questions/43354788/java-gae-task-queue-callnotfoundexception