java.lang.NoClassDefFoundError:无法初始化类com.sun.proxy。$ Proxy8

时间:2017-02-21 06:50:48

标签: java tomcat jersey

我创建了一个平针织网络服务并将其部署在tomcat 8中。当我在本地计算机上运行它时,我没有遇到任何问题。但是当我在aws中部署它时,我得到了以下异常。

java.lang.NoClassDefFoundError: Could not initialize class com.sun.proxy.$Proxy8
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
com.sun.jersey.server.impl.application.WebApplicationImpl$26.run(WebApplicationImpl.java:1626)
java.security.AccessController.doPrivileged(Native Method)
com.sun.jersey.server.impl.application.WebApplicationImpl.createProxy(WebApplicationImpl.java:1623)
com.sun.jersey.server.impl.application.WebApplicationImpl.<init>(WebApplicationImpl.java:335)
com.sun.jersey.server.impl.container.WebApplicationProviderImpl.createWebApplication(WebApplicationProviderImpl.java:55)
com.sun.jersey.spi.container.WebApplicationFactory.createWebApplication(WebApplicationFactory.java:66)
com.sun.jersey.spi.container.servlet.ServletContainer.create(ServletContainer.java:412)
com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.create(ServletContainer.java:327)
com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:603)
com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1521)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1478)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)

我找不到任何相关链接。任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

当jvm尝试初始化类com.sun.proxy时,似乎发生了错误。$ Proxy8。

大多数情况下,如果jvm无法初始化类,那么此类的任何实例创建操作都将导致NoClassDefFoundError

因此,NoClassDefFoundError不是原始异常,请检查您的日志并找到堆栈恍惚包含com.sun.proxy.$Proxy8.cinit方法的异常。