NoClassDefFoundError每秒重启Tomcat

时间:2017-09-20 09:07:07

标签: java tomcat classloader

目前我们正面临一个奇怪的问题。我们有一个很大的应用程序,它在Webapp目录中部署为ROOT.war(没有其他应用程序)。 Tomcat(8.0.32)在启动时解压缩战争。它从Windows服务开始。

当我们停止服务并再次启动它时,会发生NoClassDefFoundError(我们自己的一个类,每次都相同)。新的停止/启动后,它确实有效。停止/开始 - >不行。停止/开始 - >是否有效...

我们在Eclipse上开发,在开发过程中我们不会遇到这个问题。

我不知道如何解决这个问题。我在上下文中尝试了reloadable = false,并在主机上尝试了autoDeploy = false unpackWars = true。

我们正在使用Spring / Hibernate。


    Message: Can't instantiate page using constructor 'public my.package.MyPage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument 'p=[MyOtherPage], userName=[abc1]'. An exception has been thrown during construction!

    Root cause:

    java.lang.NoClassDefFoundError: my.package.MyPanel
         at my.package.MyPage.(MyPage.java:114)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:171)
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:99)
         at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
         at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:268)
         at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
         at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
         at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:279)
         at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
         at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
         at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
         at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
         at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
         at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
         at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
         at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
         at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
         at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:151)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
         at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
         at my.package.web.filter.MDCPersistenceFilter.doFilter(MDCPersistenceFilter.java:47)
         at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
         at my.package.web.filter.TenantContextPersistenceFilter.doFilter(TenantContextPersistenceFilter.java:59)
         at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
         at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
         at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
         at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:144)
         at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
         at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
         at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
         at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
         at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
         at ch.qos.logback.access.tomcat.LogbackValve.invoke(LogbackValve.java:256)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
         at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
         at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
         at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
         at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
         at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
         at java.lang.Thread.run(Thread.java:745)


    Complete stack:

    org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public my.package.MyPage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument 'p=[MyOtherPage], userName=[abc1]'. An exception has been thrown during construction!
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:194)
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:99)
         at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
         at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:268)
         at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
         at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
         at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:279)
         at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
         at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
         at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
         at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
         at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
         at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
         at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)

    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:171)
         at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:99)
         at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:137)
         at org.apache.wicket.core.request.handler.PageProvider.resolvePageInstance(PageProvider.java:268)
         at org.apache.wicket.core.request.handler.PageProvider.getPageInstance(PageProvider.java:166)
         at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78)
         at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:279)
         at org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:175)
         at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
         at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
         at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
         at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
         at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
         at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)

注意:我改名为公司套餐......

在MyPage的第114行,我们正在创建一个MyPanel类型的新面板。

2 个答案:

答案 0 :(得分:0)

问题是我的MyPanel.java中的一个静态{..}块没有什么奇怪的事发生在那里,但它导致了这个问题。谢谢你的帮助!

答案 1 :(得分:0)

也许您可以尝试将spring-security-core-3.1.0.RELEASE.jar放入tomcat的lib目录中