简体   繁体   中英

Google App Engine 500 error

So I've deployed my app to GAE, but all I get is a 500 error on the index page, which is just a plain crossroads site. Since I am not at all an expert on Java, I need some help with decoding the error log. Do you have any idea what to do in order to make the app work again (it has been working already)?

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)

I got this same error, and it went away when I disabled WADL in my web.xml file (see init-param stanza under the servlet-class tag). The logs hinted at this, where you see wadl references before the crash. I made this change and restarted, and it worked.

<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>

I found someone that posted a similar problem , because I too am having the same problem.

His solution that I quote:

I just played around a bit and it seems that the problem is jaxb-impl (group com.sun.xml.bind). Version 2.1.12 works (yea!), version 2.2.4 (latest) does not work on App Engine production

I had the similar stack trace, but after doing some Investigation I realized the Injector was being included in my project in a jaxb-impl library via a Maven transitive dependency of jersey-json project. I excluded the jaxb-impl library, rebuilt and redeployed and got past the problem. JAXB is provided by JDK6 so you were likely having the same problem.

<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>

It is telling you that Jetty is failing because some of the stuff that your application is using has thrown an exception during static initialization. This is causing the failure of a subsequent class load of com.sun.xml.bind.v2.runtime.reflect.opt.Injector .

Unfortunately, the root cause of the problem is not shown in these messages.

You need to check the log files for an earlier entry (probably with a stack trace) that reports the static initialization problem that triggered these ones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM