服务器遇到意外情况,无法满足请求

服务器遇到意外情况,无法满足请求

我有两个亚马逊实例,我在两个实例中上传了相同的战争,在一个实例中它运行正常(给出预期结果),但在另一个实例中它给出以下错误

javax.servlet.ServletException: Servlet.init() for servlet [Example-RS] threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)
Root Cause
java.lang.IncompatibleClassChangeError: Implementing class
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(ClassLoader.java:763)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2283)
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:811)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1260)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79)
com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)
com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)
com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700)
com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:748)

我在谷歌上搜索了这个错误,我得到了与文件相关的建议web.xml,如果它与web.xml文件相关,那么它也不应该在另一个实例中执行

答案1

根本原因是一个IncompatibleClassChangeError。根据文档,这个错误是

当某些类定义发生不兼容的类更改时抛出。当前执行的方法所依赖的某个类的定义已发生更改。

仔细检查应用程序服务器的版本以及位于 war 文件外部的所有库和类的版本。

相关内容