我的Tomcat启动后,我看到一些非常奇怪的东西。我部署了15个应用程序,在我尝试访问特定应用程序的特定页面之前,一切似乎都没问题。有一些交叉依赖,例如服务。
如果我自己部署有问题的应用程序,我可以毫无问题地查看该页面。如果我逐个部署所有其他应用程序,我可以毫无问题地查看该页面。如果所有应用程序在启动时一起部署,那么当我看到以下错误时:
严重:无法使用构造函数public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters)和参数实例化页面 org.apache.wicket.WicketRuntimeException:无法使用构造函数public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters)和参数实例化页面 在org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) 在org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) 在org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) 在org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1252) 在org.apache.wicket.RequestCycle.step(RequestCycle.java:1331) 在org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438) 在org.apache.wicket.RequestCycle.request(RequestCycle.java:546) 在org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) 在org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在com.ideasx.stats.HttpFilterStatCounter.doFilter(HttpFilterStatCounter.java:87) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) 在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607) 在org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:313) at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:918) 在java.lang.Thread.run(Thread.java:695) 引起:java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 在org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188) ......还有30多个 引起:java.lang.NoClassDefFoundError:无法初始化类net.sf.cglib.proxy.Enhancer 在org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:159) 在org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:130) 在org.apache.wicket.injection.Injector.inject(Injector.java:103) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) 在org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentInjector.java:52) 在org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:1093) 在org.apache.wicket.Component。(Component.java:926) 在org.apache.wicket.MarkupContainer。(MarkupContainer.java:113) 在org.apache.wicket.markup.html.WebMarkupContainer。(WebMarkupContainer.java:49) 在org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup。(WebMarkupContainerWithAssociatedMarkup.java:51) 在org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup。(WebMarkupContainerWithAssociatedMarkup.java:43) 在org.apache.wicket.markup.html.panel.Panel。(Panel.java:76) 在com.company.web.view.purchase.buy.BuyAGiftPanel。(BuyAGiftPanel.java:54) 在com.company.web.view.purchase.buy.BuyAGiftPage。(BuyAGiftPage.java:22) ......还有35个
我检查过依赖性冲突,并没有发现任何异常情况。所以我的问题是这个。鉴于我可以按特定顺序部署应用程序而不会看到错误,Tomcat是否有可能对此负责?我该如何找到问题?
编辑添加: 似乎在启动时,一个干净的会话和对应用程序的第一个请求抛出以下强制转换异常:
严重:无法使用构造函数public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters)和参数实例化页面 org.apache.wicket.WicketRuntimeException:无法使用构造函数public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters)和参数实例化页面 在org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) 在org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) 在org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) 在org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1252) 在org.apache.wicket.RequestCycle.step(RequestCycle.java:1331) 在org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438) 在org.apache.wicket.RequestCycle.request(RequestCycle.java:546) 在org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) 在org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在com.ideasx.stats.HttpFilterStatCounter.doFilter(HttpFilterStatCounter.java:87) 在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) 在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:918) 在java.lang.Thread.run(Thread.java:695) 引起:java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) 在org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188) ......还有30多个 引起:java.lang.ExceptionInInitializerError 在org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:159) 在org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:130) 在org.apache.wicket.injection.Injector.inject(Injector.java:103) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) 在org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentInjector.java:52) 在org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:1093) 在org.apache.wicket.Component。(Component.java:926) 在org.apache.wicket.MarkupContainer。(MarkupContainer.java:113) 在org.apache.wicket.markup.html.WebMarkupContainer。(WebMarkupContainer.java:49) 在org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup。(WebMarkupContainerWithAssociatedMarkup.java:51) 在org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup。(WebMarkupContainerWithAssociatedMarkup.java:43) 在org.apache.wicket.markup.html.panel.Panel。(Panel.java:76) 在com.company.web.view.purchase.buy.BuyAGiftPanel。(BuyAGiftPanel.java:54) 在com.company.web.view.purchase.buy.BuyAGiftPage。(BuyAGiftPage.java:22) ......还有35个 引起:java.lang.ClassCastException:net.sf.cglib.proxy.Enhancer $ EnhancerKey $$ KeyFactoryByCGLIB $$ 7fb24d72无法强制转换为net.sf.cglib.core.KeyFactory at net.sf.cglib.core.KeyFactory $ Generator.create(KeyFactory.java:145) 在net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) 在net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) 在net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) 在net.sf.cglib.proxy.Enhancer。(Enhancer.java:69) ......还有49个
答案 0 :(得分:0)
删除所有服务器日志,Tomcat中的所有临时文件并重试。这很多次都解决了这类问题。
答案 1 :(得分:0)
这似乎并不特定于Tomcat。在搜索了一些后,我发现cglib_nodep依赖项有一些类加载问题。我从树中排除了这个库,明确定义了cglib 2.2版,它清理了一切。