marcusschiesser / openbahn-api

Wrapper of REST-style webservices for bahn.de
Other
72 stars 13 forks source link

Google App Engine 1.8.2 compatibility #4

Open khawkins98 opened 11 years ago

khawkins98 commented 11 years ago

I've just set up this API on GAE, but haven't been able to get anything but 500 errors.

I don't have much experience with Java, but a bit of Googling suggests that the init param setup in web.xml may be off ( example: http://stackoverflow.com/questions/7205761/jersey-tutorials-from-basics )

I suspect this is because I'm having to use GAE 1.8.2 and the API was last updated for 1.6.1

Or am I way wrong on this?


2013-07-30 03:38:57.354 /rest/stations/list?contains=karlsruhe 500 72ms 0kb Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36
87.158.184.175 - - [30/Jul/2013:03:38:57 -0700] "GET /rest/stations/list?contains=karlsruhe HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36" "REDACTED.appspot.com" ms=73 cpu_ms=53 app_engine_release=1.8.2 instance=00c61b117cf4581821db93ab4c51fd15ea1160
C 2013-07-30 03:38:57.352
Uncaught exception from servlet
javax.servlet.UnavailableException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
    at org.mortbay.jetty.servlet.ServletHolder.makeUnavailable(ServletHolder.java:415)
    at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:458)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:439)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:483)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:490)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:777)
    at com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:754)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:345)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:337)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:487)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:679)
marcusschiesser commented 11 years ago

I also think it's because your using App Engine 1.8.2, but the web.xml looks like it is configured correctly. I would try updating jersey too and look for incompatibilities with App Engine and Jersey. Maybe you also find a simple working example with GAE 1.8.2 and the latest Jersey.