Update: When I disable GWT for my project, this problem goes away!
I’ve been happily using task queues in appengine for several months, and dev mode testing has been great on my Mac OS X machine.
Today, it all came crashing down.
[ERROR] Job CleanupQueue.task1 threw an unhandled Exception:
com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 2: Received exception executing http method POST against URL http://0.0.0.0:8888/tasks/cleanup: Connection to http://0.0.0.0:8888 refused
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:381)
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue$UrlFetchServiceLocalTaskQueueCallback.execute(LocalTaskQueue.java:480)
at com.google.appengine.api.taskqueue.dev.UrlFetchJob.execute(UrlFetchJob.java:77)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
[ERROR] Job (CleanupQueue.task1 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 2: Received exception executing http method POST against URL http://0.0.0.0:8888/tasks/cleanup: Connection to http://0.0.0.0:8888 refused]
at org.quartz.core.JobRunShell.run(JobRunShell.java:214)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
* Nested Exception (Underlying Cause) ---------------
com.google.apphosting.api.ApiProxy$ApplicationException: ApplicationError: 2: Received exception executing http method POST against URL http://0.0.0.0:8888/tasks/cleanup: Connection to http://0.0.0.0:8888 refused
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:381)
at com.google.appengine.api.taskqueue.dev.LocalTaskQueue$UrlFetchServiceLocalTaskQueueCallback.execute(LocalTaskQueue.java:480)
at com.google.appengine.api.taskqueue.dev.UrlFetchJob.execute(UrlFetchJob.java:77)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
I haven’t changed anything in my project, and reverting to a previously-working version does n’t help. 0.0.0.0 is an ip coming internally from the dev server – all of my other references use localhost or 127.0.0.1. I did recently install some OS updates from Apple, but I would have sworn that dev mode has worked between then and now.
Where can I start looking for the cause? Thanks for any ideas – I’m stumped!
Note: the same code and setup on my windows machines works great.
Note 2: starting from scratch with the GAE java sdk 1.5.5, I made the simplest-possible taskqueue sample app and got the same connection refused messages.
Extra Info
ifconfig:
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
inet 127.0.0.1 netmask 0xff000000
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether c8:2a:14:0d:d8:e8
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
media: autoselect (none)
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr 70:cd:60:ff:fe:6a:28:ae
media: autoselect <full-duplex>
status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 78:ca:39:b4:c3:8a
inet6 fe80::7aca:39ff:feb4:c38a%en1 prefixlen 64 scopeid 0x6
inet 192.168.2.3 netmask 0xffffff00 broadcast 192.168.2.255
media: autoselect
status: active
I’ve worked around the problem.
The class that launches a GWT&GAE project from eclipse is
com.google.appengine.tools.development.gwt.AppEngineLauncher. This class hard-codes0.0.0.0as the IP to bind to, which according to the comments should cause it to listen on all interfaces.I just copied the code from this class into an
AppEngineLauncherHackclass, which hard-codes a more specific IP (in my case,192.168.0.12), and changed my run configuration to use this class instead.I haven’t figured out what the ultimate conflict was. I don’t know why 0.0.0.0 used to work, but doesn’t anymore. Unsatisfying, and definitely a kluge – if this starts happening on other machines, we’ll have to make a new
AELauncherHackclass for every computer! But at least now we can get back to business.Thanks for the help everyone – I’m sorry I could only award the bounty to one person!