问题现象 :
TongWeb企业版部署web应用,报错如下:
[2022-02-26 22:25:42 816] [SEVERE] [http-nio2-0.0.0.0-9060-exec-1] [core] [Parse error in application web.xml file at file:/D:/TongWeb /conf/default-web.xml] org.xml.sax.SAXParseException; systemId: file:/D:/TongWeb /conf/default-web.xml; lineNumber: 90; columnNumber: 15; Error at (90, 15) : com.tongweb.catalina.startup.OpenEJBContextConfig$OpenEJBWebXml addServlet ?? ?at com.tongweb.web.util.digester.Digester.createSAXException(Digester.java:1911) ?? ?at com.tongweb.web.util.digester.Digester.createSAXException(Digester.java:1943) ?? ?at com.tongweb.web.util.digester.Digester.endElement(Digester.java:976) ?? ?at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610) ?? ?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1784) ?? ?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2969) ?? ?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) ?? ?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507) ?? ?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:867) ?? ?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:796) ?? ?at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:142) ?? ?at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216) ?? ?at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:644) ?? ?at com.tongweb.web.util.digester.Digester.parse(Digester.java:1462) ?? ?at com.tongweb.web.util.descriptor.web.WebXmlParser.parseWebXml(WebXmlParser.java:119) ?? ?at com.tongweb.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1548) ?? ?at com.tongweb.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1112) ?? ?at com.tongweb.catalina.startup.OpenEJBContextConfig.webConfig(OpenEJBContextConfig.java:402) ?? ?at com.tongweb.catalina.startup.ContextConfig.configureStart(ContextConfig.java:775) ?? ?at com.tongweb.catalina.startup.OpenEJBContextConfig.configureStart(OpenEJBContextConfig.java:123) ?? ?at com.tongweb.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299) ?? ?at com.tongweb.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94) ?? ?at com.tongweb.catalina.core.StandardContext.startInternal(StandardContext.java:5172) ?? ?at com.tongweb.catalina.core.ThanosStandardContext.startInternal(ThanosStandardContext.java:250) ?? ?at com.tongweb.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ?? ?at com.tongweb.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:734) ?? ?at com.tongweb.catalina.core.ContainerBase.addChild(ContainerBase.java:710) ?? ?at com.tongweb.catalina.core.StandardHost.addChild(StandardHost.java:725) ?? ?at com.tongweb.catalina.core.ThanosStandardHost.addChild(ThanosStandardHost.java:645) ?? ?at com.tongweb.web.thanos.startup.ThanosHostConfig.deployWar(ThanosHostConfig.java:230) ?? ?at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.fireWebtierProcess(ThanosWebtierWebAppBuilder.java:448) ?? ?at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.deployApplication(ThanosWebtierWebAppBuilder.java:360) ?? ?at com.tongweb.deploy.TongWebDeployer.deploy0(TongWebDeployer.java:337) ?? ?at com.tongweb.deploy.TongWebDeployer.deploy(TongWebDeployer.java:297) ?? ?at com.tongweb.deploy.commands.DeployCommand.deploy(DeployCommand.java:270) ?? ?at com.tongweb.console.deployer.service.DeployerService.deploy(DeployerService.java:764) ?? ?at com.tongweb.console.deployer.controller.DeployerController.deploy(DeployerController.java:391) ?? ?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ?? ?at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ?? ?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ?? ?at java.lang.reflect.Method.invoke(Method.java:498) ?? ?at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) ?? ?at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296) ?? ?at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) ?? ?at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237) ?? ?at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.createModelAndView(ResteasyHandlerAdapter.java:96) ?? ?at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:82) ?? ?at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:26) ?? ?at org.jboss.resteasy.springmvc.ResteasyWebHandlerTemplate.handle(ResteasyWebHandlerTemplate.java:39) ?? ?at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:47) ?? ?at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ?? ?at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ?? ?at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ?? ?at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ?? ?at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) ?? ?at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ?? ?at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.web.websocket.server.WsFilter.doFilter(WsFilter.java:53) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.console.util.SpringI18nFilter.doFilter(SpringI18nFilter.java:46) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.console.commons.LoginFilter.doFilter(LoginFilter.java:50) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.console.commons.ConsoleFilter.doFilter(ConsoleFilter.java:68) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) ?? ?at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.tw.AuthorityFilter.doFilter(AuthorityFilter.java:47) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.console.commons.NoCacheFilter.doFilter(NoCacheFilter.java:18) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.console.audit.AuditFilter.doFilter(AuditFilter.java:112) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ?? ?at com.tongweb.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ?? ?at com.tongweb.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ?? ?at com.tongweb.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) ?? ?at com.tongweb.catalina.core.ThanosStandardContextValve.invoke(ThanosStandardContextValve.java:107) ?? ?at com.tongweb.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:44) ?? ?at com.tongweb.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:570) ?? ?at com.tongweb.catalina.core.StandardHostValve.invoke(StandardHostValve.java:344) ?? ?at com.tongweb.tomee.catalina.OpenEJBSecurityListener$RequestCapturer.invoke(OpenEJBSecurityListener.java:97) ?? ?at com.tongweb.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) ?? ?at com.tongweb.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ?? ?at com.tongweb.catalina.core.ThanosStandardEngineValve.invoke(ThanosStandardEngineValve.java:43) ?? ?at com.tongweb.catalina.realm.RealmValve.invoke(RealmValve.java:21) ?? ?at com.tongweb.catalina.connector.ThanosCoyoteAdaptor.service(ThanosCoyoteAdaptor.java:469) ?? ?at com.tongweb.coyote.http11.Http11Processor.service(Http11Processor.java:867) ?? ?at com.tongweb.coyote.http11.ThanosHttp11Processor.service(ThanosHttp11Processor.java:19) ?? ?at com.tongweb.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ?? ?at com.tongweb.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:921) ?? ?at com.tongweb.web.util.net.Nio2Endpoint$SocketProcessor.doRun(Nio2Endpoint.java:1625) ?? ?at com.tongweb.web.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ?? ?at com.tongweb.web.util.net.AbstractEndpoint.processSocket(AbstractEndpoint.java:857) ?? ?at com.tongweb.web.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:522) ?? ?at com.tongweb.web.util.net.Nio2Endpoint$Nio2SocketWrapper$2.completed(Nio2Endpoint.java:514) ?? ?at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) ?? ?at sun.nio.ch.Invoker$2.run(Invoker.java:218) ?? ?at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) ?? ?at com.tongweb.web.util.threads.TWThreadPoolExecutor.runWorker(TWThreadPoolExecutor.java:1172) ?? ?at com.tongweb.web.util.threads.TWThreadPoolExecutor$Worker.run(TWThreadPoolExecutor.java:628) ?? ?at com.tongweb.web.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ?? ?at java.lang.Thread.run(Thread.java:750) Caused by: java.lang.NoSuchMethodException: com.tongweb.catalina.startup.OpenEJBContextConfig$OpenEJBWebXml addServlet ?? ?at com.tongweb.web.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:374) ?? ?at com.tongweb.web.util.digester.SetNextRule.end(SetNextRule.java:145) ?? ?at com.tongweb.web.util.digester.Digester.endElement(Digester.java:973) ?? ?... 109 more
原因:
? ? ? ?war应用包里的WEB-INF/lib目录下有tongweb-embed-7.0.E.*.jar,这样导致TongWeb企业版的类调用TongWeb嵌入版的类来解析TongWeb企业版的conf/default-web.xml文件。
#通过日志可看,如下为嵌入版的类at?com.tongweb.web.util.descriptor.web.WebXmlParser.parseWebXml(WebXmlParser.java:119)
#如下为企业版的类 at com.tongweb.catalina.startup.ContextConfig.getDefaultWebXmlFragment(ContextConfig.java:1548)
#最后嵌入版的类调用企业版的类,找不到方法
Caused by: java.lang.NoSuchMethodException: com.tongweb.catalina.startup.OpenEJBContextConfig$OpenEJBWebXml addServlet ?? ?at com.tongweb.web.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:374)??
解决办法:
? ? ? ? 删掉web应用里 tongweb-embed-7.0.E.*.jar及相关的jar。 这些jar在war应用运行时不需要,只有在以spring boot jar方式时需要。
|