gpt4 book ai didi

java - Tomcat : Application errors when multiple WARs deployed

转载 作者:行者123 更新时间:2023-12-01 12:05:50 26 4
gpt4 key购买 nike

我的 Tomcat 启动后看到一些非常奇怪的东西。我部署了 15 个应用程序,在我尝试访问特定应用程序上的特定页面之前,一切似乎都正常。有一些交叉依赖,例如服务。

如果我单独部署有问题的应用程序,我可以毫无问题地查看该页面。如果我一一部署所有其他应用程序,我可以毫无问题地查看该页面。如果所有应用程序在启动时一起部署,那么我会看到以下错误:

SEVERE: Can't instantiate page using constructor public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters) and argument org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters) and argument at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at 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) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438) at org.apache.wicket.RequestCycle.request(RequestCycle.java:546) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.ideasx.stats.HttpFilterStatCounter.doFilter(HttpFilterStatCounter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at 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) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at 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:313) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:695) Caused by: 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) at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188) ... 30 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:159) at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:130) at org.apache.wicket.injection.Injector.inject(Injector.java:103) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) at org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentInjector.java:52) at org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:1093) at org.apache.wicket.Component.(Component.java:926) at org.apache.wicket.MarkupContainer.(MarkupContainer.java:113) at org.apache.wicket.markup.html.WebMarkupContainer.(WebMarkupContainer.java:49) at org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.(WebMarkupContainerWithAssociatedMarkup.java:51) at org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.(WebMarkupContainerWithAssociatedMarkup.java:43) at org.apache.wicket.markup.html.panel.Panel.(Panel.java:76) at com.company.web.view.purchase.buy.BuyAGiftPanel.(BuyAGiftPanel.java:54) at com.company.web.view.purchase.buy.BuyAGiftPage.(BuyAGiftPage.java:22) ... 35 more

我检查了依赖冲突,没有发现任何异常。所以我的问题是这样的。鉴于我可以按特定顺序部署应用程序并且看不到错误,Tomcat 是否可能对此负责?我该如何找到问题所在?

编辑添加:似乎在启动时,一个干净的 session 和对应用程序的第一个请求会抛出以下强制转换异常:

SEVERE: Can't instantiate page using constructor public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters) and argument org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public com.company.web.view.purchase.buy.BuyAGiftPage(org.apache.wicket.PageParameters) and argument at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:212) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at 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) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438) at org.apache.wicket.RequestCycle.request(RequestCycle.java:546) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.ideasx.stats.HttpFilterStatCounter.doFilter(HttpFilterStatCounter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at 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) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at 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) at java.lang.Thread.run(Thread.java:695) Caused by: 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) at org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188) ... 30 more Caused by: java.lang.ExceptionInInitializerError at org.apache.wicket.proxy.LazyInitProxyFactory.createProxy(LazyInitProxyFactory.java:159) at org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:130) at org.apache.wicket.injection.Injector.inject(Injector.java:103) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39) at org.apache.wicket.injection.ComponentInjector.onInstantiation(ComponentInjector.java:52) at org.apache.wicket.Application.notifyComponentInstantiationListeners(Application.java:1093) at org.apache.wicket.Component.(Component.java:926) at org.apache.wicket.MarkupContainer.(MarkupContainer.java:113) at org.apache.wicket.markup.html.WebMarkupContainer.(WebMarkupContainer.java:49) at org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.(WebMarkupContainerWithAssociatedMarkup.java:51) at org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup.(WebMarkupContainerWithAssociatedMarkup.java:43) at org.apache.wicket.markup.html.panel.Panel.(Panel.java:76) at com.company.web.view.purchase.buy.BuyAGiftPanel.(BuyAGiftPanel.java:54) at com.company.web.view.purchase.buy.BuyAGiftPage.(BuyAGiftPage.java:22) ... 35 more Caused by: java.lang.ClassCastException: net.sf.cglib.proxy.Enhancer$EnhancerKey$$KeyFactoryByCGLIB$$7fb24d72 cannot be cast to net.sf.cglib.core.KeyFactory at net.sf.cglib.core.KeyFactory$Generator.create(KeyFactory.java:145) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:117) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108) at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104) at net.sf.cglib.proxy.Enhancer.(Enhancer.java:69) ... 49 more

最佳答案

这似乎不是 Tomcat 特有的。经过更多搜索后,我发现 cglib_nodep 依赖项存在一些类加载问题。我从树中排除了这个库,明确定义了 cglib 版本 2.2,它解决了问题。

http://forum.spring.io/forum/spring-projects/web/flex/65337-an-strange-error-with-net-sf-cglib-core-keyfactory

关于java - Tomcat : Application errors when multiple WARs deployed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27610788/

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