Actually its the "i'm doing something stupid". I forgot that I was using a servlet filter that was intercepting all unauthenticated requests and redirecting to a login page. When the task is executed by app engine, it is not authenticated (not associated with a user), so it was redirected and returning 200 like it should. Looks like things are working now after fixing that. Thanks for the suggestion though.
On Mar 7, 3:50 am, Toby <[email protected]> wrote: > Hi, > > maybe it is the Method.GET? > I just do like this: > Queue queue = QueueFactory.getDefaultQueue(); > > queue.add(TaskOptions.Builder.url("/tasks/foo")); > > and make sure you handle post and get requests in the servlet, just in > case. > > Cheers, > Toby > > On Mar 6, 4:07 am, rletness <[email protected]> wrote: > > > Ok so either I'm doing something really stupid or I can't get a simple > > task to execute. I have defined a task worker at /tasks/foo. > > > I can hit /tasks/foo no problem and the code executes fine (just a > > simple servlet of course). The problem is when I add a task to the > > queue like: > > > queue.add(TaskOptions.Builder.url("/tasks/foo").method(Method.GET)); > > > I can't seem to get the code in the task servlet to execute. If I > > check the queue in admin console it shows a task executed and in the > > request logs it shows that /foo/task was called and returned 200, but > > the code never executed. Just to make sure I wasn't insane I modified > > the task servlet to simply throw a RuntimeException so it would return > > 500. When invoked manually, it returns 500 as expected, but when > > invoked through the task queue, it shows /tasks/foo returning 200. > > Any ideas? > > > Here is the request log. The first request is the one i invoked > > manually from the browser and the second is one invoked by the task > > queue. It shows the first returning 500 (as expected) but the second > > returns 200. > > > 1. > > 03-05 06:38PM 54.097 /tasks/foo 500 37ms 38cpu_ms 3kb Mozilla/ > > 5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.8) Gecko/ > > 20100202 Firefox/3.5.8,gzip(gfe),gzip(gfe) > > > 1. > > 03-05 06:37PM 54.803 /tasks/foo 200 60ms 19cpu_ms 3kb AppEngine- > > Google; (+http://code.google.com/appengine) -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
