我和Jetty一起工作。但是当我尝试在我的代码Java 8期货中使用时,我在打开第一页时看到错误:
23-05-2017 16:34:27:896 WARN ContextHandler$Context log unavailable
java.lang.ArrayIndexOutOfBoundsException: 27745
at org.objectweb.asm.ClassReader.readClass(ClassReader.java:2015)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:469)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.process(AnnotationAcceptingListener.java:167)
at org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:850)
at org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:808)
at org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:723)
at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1120)
at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1093)
at org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1089)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:275)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:637)
at org.eclipse.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:498)
at org.eclipse.jetty.servlet.ServletHolder.ensureInstance(ServletHolder.java:785)
at org.eclipse.jetty.servlet.ServletHolder.prepare(ServletHolder.java:770)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:538)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1592)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1239)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:481)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1561)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1141)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:118)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:745)
23-05-2017 16:34:27:898 WARN HttpChannel handleException /gains/login/checksession
javax.servlet.ServletException: javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-69d45cca@3758310d==org.glassfish.jersey.servlet.ServletContainer,jsp=null,order=-1,inst=false
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:138)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:564)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.servlet.ServletException: org.glassfish.jersey.servlet.ServletContainer-69d45cca@3758310d==org.glassfish.jersey.servlet.ServletContainer,jsp=null,order=-1,inst=false
如果我们更新Jetty库,但我们认为我们可以避免这个问题,但问题仍然存在。
我们使用Jetty 9.4。
答案 0 :(得分:1)
我猜你使用旧版本的asm.jar和更新的编译Java字节码。
对于Java 8字节码,请使用asm 5.0.1 +
请参阅Strange java.lang.ArrayIndexOutOfBoundsException thrown on jetty startup
不要忘记将cglib.jar更新为正确的版本,因为它将asm作为依赖项