当前位置: 首页 > 知识库问答 >
问题:

NoClassDefFoundError每秒重启Tomcat

冉昊
2023-03-14

目前我们面临着一个奇怪的问题。我们有一个很大的应用程序,它作为root.war部署在webapp目录中(没有其他应用程序)。Tomcat(8.0.32)在启动时解包战争。它以Windows服务的形式开始。

当我们停止服务并再次启动它时,NoClassDefFoundError就会出现(我们自己的类之一,每次都是一样的)。在一次新的停止/启动后,它确实起作用了。停止/开始->不起作用。停止/开始->做工作等等...


    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)

共有1个答案

厍建义
2023-03-14

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

 类似资料:
  • 问题内容: 我正在使用WOW.js和animate.css,现在我正在将CSS运行到Infinite。我想知道如何让我的课程在3秒钟内停止运行并再次开始无限运行? 我的html: 我的CSS类: 解决方案可以是JS或CSS3。 问题答案: 对于纯CSS3动画,在动画的每个单次迭代之间添加延迟的一种方法是修改关键帧设置,以使其产生所需的延迟。 在以下代码段中,正在执行以下操作: 动画的整个持续时间为

  • 问题内容: 我想知道如何每x秒重绘和更新JPanel的背景…这是我的代码: 我的代码有2个问题:1-JPanel根本没有被绘制。2-第一张可以打印,然后每次打印数量增加一倍。有什么建议吗?先感谢您 更新:我以这种方式解决了这个问题: 更新2: 问题答案: 使用Swing计时器,

  • 我正在尝试使用 DropWizard 指标库在我的应用程序上测量应用程序和 jvm 级别的指标。 下面是我的度量类,我在代码中使用它来增加/减少度量。我正在调用下面类的< code>increment和< code>decrement方法来递增和递减度量。 下面是我如何使用上面的<code>TestMetrics</code>类来根据需要增加度量的基础。下面的方法由多个线程调用。 现在我有了另一个

  • 问题内容: 我想每0.5秒触发一次功能,并且能够启动,停止和重置计时器。我不太了解Python线程的工作方式,并且在使用python计时器时遇到了困难。 但是,当我执行两次时,我会不断得到帮助。有没有解决的办法?我尝试在每次开始之前申请。 伪代码: 问题答案: 最好的方法是一次启动计时器线程。在计时器线程中,你需要编写以下代码 然后,在启动计时器的代码中,可以停止事件来停止计时器。

  • 问题内容: 以给定的速率安排一段Java代码的最简单方法是什么? 问题答案: 在Java 5+中,带有: 上面的方法是有利的。在Java 5之前,您使用和:

  • 问题内容: 我有一个简单的Java程序,该程序读取一个文本文件,将其分隔为“”(空格),显示第一个单词,等待2秒,显示下一个…等等…我想在Spring或其他一些GUI。 关于如何使用spring轻松更新单词的任何建议?遍历我的列表并以某种方式使用setText(); 我没有运气。我正在使用此方法在consol中打印我的单词,并向其中添加JFrame …在consol中效果很好,但是却发出了无尽的j