Spring servlet / main不可用

时间:2016-11-08 21:05:27

标签: spring spring-mvc embedded-jetty jetty-9

我刚刚将我的Spring webapp从Java 7升级到Java 8并将Jetty 7嵌入到Jetty 9

当我使用Eclipse Jetty Integration启动webapp时,Webapp似乎从日志开始,但是我在控制台上遇到以下错误:

    2016-11-07 23:35:51.638:INFO:/:main: Initializing Spring FrameworkServlet 'appServlet'
07 Nov 2016 23:35:51,642 [main] XmlValidatorContext INFO  - Refreshing WebApplicationContext for namespace 'appServlet-servlet': startup date [Mon Nov 07 23:35:51 EST 2016]; parent: Root WebApplicationContext
07 Nov 2016 23:35:52,473 [main] Version INFO  - HV000001: Hibernate Validator 5.1.3.Final
2016-11-07 23:35:53.413:WARN:/:main: unavailable
java.lang.ClassCastException: org.eclipse.jetty.util.DecoratedObjectFactory cannot be cast to org.eclipse.jetty.util.DecoratedObjectFactory
    at org.eclipse.jetty.websocket.server.WebSocketServerFactory.init(WebSocketServerFactory.java:369)
    at org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:136)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:419)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:875)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:411)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:378)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9Adapter.start(Jetty9Adapter.java:68)
    at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
    at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9LauncherMain.main(Jetty9LauncherMain.java:42)
2016-11-07 23:35:53.414:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@4cc8eb05{/,file:///home/bgandhi/mc-git-repos/mc-upgrade/mc/src/lib/webui/src/main/webapp/,UNAVAILABLE}{/home/bgandhi/mc-git-repos/mc-upgrade/mc/src/lib/webui/src/main/webapp}
javax.servlet.ServletException: java.lang.ClassCastException: org.eclipse.jetty.util.DecoratedObjectFactory cannot be cast to org.eclipse.jetty.util.DecoratedObjectFactory
    at org.eclipse.jetty.websocket.servlet.WebSocketServlet.init(WebSocketServlet.java:142)
    at javax.servlet.GenericServlet.init(GenericServlet.java:244)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:640)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:419)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:875)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:349)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:411)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:378)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9Adapter.start(Jetty9Adapter.java:68)
    at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
    at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9LauncherMain.main(Jetty9LauncherMain.java:42)

此外,在服务器启动控制台显示以下错误时:

2016-11-07 23:35:42.999:WARN:oejut.QueuedThreadPool:qtp780237624-136: 
java.lang.IncompatibleClassChangeError: org/eclipse/jetty/annotations/AnnotationParser$MyClassVisitor
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:1004)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:984)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:933)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:851)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:546)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745)
2016-11-07 23:35:42.999:WARN:oejut.QueuedThreadPool:qtp780237624-136: Unexpected thread death: org.eclipse.jetty.util.thread.QueuedThreadPool$2@4eb937d1 in qtp780237624{STARTED,1<=27<=200,i=12,q=0}
2016-11-07 23:35:43.006:WARN:oejut.QueuedThreadPool:qtp780237624-143: 
java.lang.IncompatibleClassChangeError: org/eclipse/jetty/annotations/AnnotationParser$MyClassVisitor
    at org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:1004)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:984)
    at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:933)
    at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:851)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:163)
    at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:546)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
    at java.lang.Thread.run(Thread.java:745) ...

我不确定上述错误是如何造成的。对于第二个错误,一些帖子建议我应该将asm.jar更新为5.1。我的WebApp库中有asm-5.1.7.jar和asm-commons-5.1.jar。如果有人可以提供有关错误的一些见解,那将会很有帮助。

提前致谢!

0 个答案:

没有答案