gpt4 book ai didi

java - NoClassDefFoundError 每一次 Tomcat 重启

转载 作者:行者123 更新时间:2023-11-28 23:18:41 29 4
gpt4 key购买 nike

目前我们面临一个奇怪的问题。我们有一个大型应用程序,它作为 ROOT.war 部署在 webapp 目录中(没有其他应用程序)。 Tomcat(8.0.32)在启动时解压war。它作为 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 的新面板。

最佳答案

问题出在我的 MyPanel.java 中的静态 { .. } block 那里没有发生任何奇怪的事情,但它导致了这个问题。感谢您的帮助!

关于java - NoClassDefFoundError 每一次 Tomcat 重启,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46317768/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com