jersey在启动时失败,堆栈跟踪如下我在CentOS7.9上,OpenJDK8在Tomcat9上运行

mqkwyuun  于 2021-10-10  发布在  Java
关注(0)|答案(0)|浏览(287)
java.lang.IllegalArgumentException
        at jersey.repackaged.org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
        at jersey.repackaged.org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:64)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener$AnnotatedClassVisitor.<init>(AnnotationAcceptingListener.java:169)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener$AnnotatedClassVisitor.<init>(AnnotationAcceptingListener.java:153)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.<init>(AnnotationAcceptingListener.java:121)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.newJaxrsResourceAndProviderListener(AnnotationAcceptingListener.java:93)
        at org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:902)
        at org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:863)
        at org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:772)
        at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1213)
        at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1186)
        at org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1182)
        at org.glassfish.jersey.server.ApplicationHandler$RuntimeConfigConfigurator.init(ApplicationHandler.java:182)
        at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:290)
        at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:290)
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259)
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
        at javax.servlet.GenericServlet.init(GenericServlet.java:158)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:983)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4902)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5206)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:829)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
08-Jun-2021 09:51:10.649 SEVERE [main] org.apache.catalina.core.StandardContext.loadOnStartup Servlet [Jersey Web Application] in web application [] threw load() exception
    java.lang.IllegalArgumentException
        at jersey.repackaged.org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:79)
        at jersey.repackaged.org.objectweb.asm.ClassVisitor.<init>(ClassVisitor.java:64)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener$AnnotatedClassVisitor.<init>(AnnotationAcceptingListener.java:169)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener$AnnotatedClassVisitor.<init>(AnnotationAcceptingListener.java:153)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.<init>(AnnotationAcceptingListener.java:121)
        at org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.newJaxrsResourceAndProviderListener(AnnotationAcceptingListener.java:93)
        at org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:902)
        at org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:863)
        at org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:772)
        at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1213)
        at org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.<init>(ResourceConfig.java:1186)
        at org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1182)
        at org.glassfish.jersey.server.ApplicationHandler$RuntimeConfigConfigurator.init(ApplicationHandler.java:182)
        at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:290)
        at java.util.Arrays$ArrayList.forEach(Arrays.java:3880)
        at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:290)
        at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:259)
        at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
        at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
        at javax.servlet.GenericServlet.init(GenericServlet.java:158)
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:983)
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4902)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5206)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:829)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:433)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

我感到更加困惑,因为完全相同的设置在linux机器上运行良好,唯一的区别在于ram大小。我尝试在这两台机器上卸载并重新安装jdk和tomcat。同样的结果,它在一台机器上工作,在另一台机器上不工作。请告知。我没有使用maven,我希望在这一点上是这样的。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题