Google App Engine 500错误

时间:2011-11-25 23:21:14

标签: java google-app-engine

所以我已将我的应用程序部署到GAE,但我得到的只是索引页面上的500错误,这只是一个简单的十字路口网站。由于我根本不是Java的专家,因此我需要一些解码错误日志的帮助。 你有什么想法让应用程序再次运行(它已经工作)了吗?

Failed startup of context com.google.apphosting.utils.jetty.RuntimeAppEngineWebAppContext@1370ce9{/,/base/data/home/apps/s~dobekologistics/3.354826916826026599}
    org.mortbay.util.MultiException[java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector, java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector]
        at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:656)
        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:202)
        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:171)
        at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
        at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:392)
        at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
        at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
        at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
        at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:162)
        at java.lang.Thread.run(Thread.java:679)
    java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector
        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:79)
        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
        at com.sun.xml.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:65)
        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:84)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:96)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:330)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:159)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:311)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:392)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:357)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:264)
        at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:66)
        at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:94)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initWadl(WebApplicationImpl.java:1207)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:1106)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:912)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589)
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:403)
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:252)
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:550)
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
        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.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
        at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
        at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
        at java.lang.Thread.run(Thread.java:679)
    java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector
        at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:79)
        at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:165)
        at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:256)
        at com.sun.xml.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:65)
        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:84)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:96)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:58)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:33)
        at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:124)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:179)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:515)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:330)
        at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
        at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:159)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:311)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:392)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:357)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:264)
        at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:66)
        at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:94)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initWadl(WebApplicationImpl.java:1207)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:1106)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:912)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:589)
        at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:403)
        at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:252)
        at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:550)
        at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:201)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:307)
        at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:470)
        at javax.servlet.GenericServlet.init(GenericServlet.java:212)
        at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
        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.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
        at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
        at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
        at java.lang.Thread.run(Thread.java:679)

    Uncaught exception from servlet
    javax.servlet.UnavailableException: Initialization failed.
        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:211)
        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:171)
        at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123)
        at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:392)
        at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
        at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
        at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
        at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:162)
        at java.lang.Thread.run(Thread.java:679)

4 个答案:

答案 0 :(得分:3)

我遇到了同样的错误,当我在web.xml文件中禁用WADL时它就消失了(参见servlet-class标签下的init-param节)。日志暗示了这一点,你会在崩溃前看到wadl引用。我做了这个改变并重新启动,它运作了。

<servlet>
    <servlet-name>jerseywebapp</servlet-name>
    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
        <param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
        <param-value>true</param-value>
    </init-param>

答案 1 :(得分:1)

我找到了发布了similar problem的人,因为我也遇到了同样的问题。

他引用的解决方案:

  

我只是玩了一下,似乎问题是jaxb-impl   (group com.sun.xml.bind)。   版本2.1.12工作(是啊!),版本2.2.4(最新)不起作用   App Engine制作

答案 2 :(得分:1)

我有类似的堆栈跟踪,但在做了一些调查后,我意识到Injector通过jersey-json项目的Maven传递依赖项被包含在我的项目中的jaxb-impl库中。我排除了jaxb-impl库,重建并重新部署并解决了问题。 JAXB由JDK6提供,因此您可能遇到同样的问题。

<dependency>
 <groupId>com.sun.jersey</groupId>
  <artifactId>jersey-json</artifactId>
  <version>1.11</version>
  <scope>runtime</scope>
  <exclusions>
    <exclusion>
      <groupId>com.sun.xml.bind</groupId>
       <artifactId>jaxb-impl</artifactId>
    </exclusion>
 </exclusions>
</dependency>

答案 3 :(得分:0)

它告诉你Jetty失败了,因为你的应用程序正在使用的一些东西在静态初始化期间抛出异常。这导致后续类加载失败com.sun.xml.bind.v2.runtime.reflect.opt.Injector

不幸的是,这些消息中没有显示问题的根本原因。

您需要检查日志文件以查找之前的条目(可能带有堆栈跟踪),该条目报告触发这些条目的静态初始化问题。