问题描述
10:12:37,120ERROR[[/association]]StandardWrapper.Throwableorg.apache.velocity.tools.config.ConfigurationException:Couldn'tfindnecessarysupportingclassesfor:UnsupportedTool'errors'=>org.apache.velocity.tools.struts.ErrorsToolwith1properties[key-auto->errors;](java.lang.NoClassDefFoundError:org/apache/struts/action/ActionMessages)atorg.apache.velocity.tools.config.ToolConfiguration.validate(ToolConfiguration.java:356)atorg.apache.velocity.tools.config.CompoundConfiguration.validate(CompoundConfiguration.java:115)atorg.apache.velocity.tools.config.ToolboxConfiguration.validate(ToolboxConfiguration.java:108)atorg.apache.velocity.tools.config.CompoundConfiguration.validate(CompoundConfiguration.java:115)atorg.apache.velocity.tools.config.FactoryConfiguration.validate(FactoryConfiguration.java:232)atorg.apache.velocity.tools.ToolboxFactory.configure(ToolboxFactory.java:80)atorg.apache.velocity.tools.ToolManager.configure(ToolManager.java:90)atorg.apache.velocity.tools.view.ViewToolManager.configure(ViewToolManager.java:213)atorg.apache.velocity.tools.view.VelocityView.configure(VelocityView.java:508)atorg.apache.velocity.tools.view.VelocityView.init(VelocityView.java:313)atorg.apache.velocity.tools.view.VelocityView.<init>(VelocityView.java:213)atorg.apache.velocity.tools.view.VelocityView.<init>(VelocityView.java:195)atorg.apache.velocity.tools.view.servlet.VelocityViewServlet.getVelocityView(VelocityViewServlet.java:67)atorg.apache.velocity.tools.view.VelocityViewServlet.init(VelocityViewServlet.java:122)atorg.apache.velocity.tools.view.servlet.VelocityViewServlet.init(VelocityViewServlet.java:51)atorg.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)atorg.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)atorg.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:623)atorg.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)atorg.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)atcom.opensymphony.sitemesh.compatability.OldDecorator2NewDecorator.render(OldDecorator2NewDecorator.java:46)atcom.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator.render(BaseWebAppDecorator.java:33)atcom.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:84)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.dhgate.apsaras.internation.InternationalizationFilter.doFilter(InternationalizationFilter.java:45)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)atorg.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)atjava.lang.Thread.run(Thread.java:662)
解决方案
解决方案二:
java.lang.NoClassDefFoundError:org/apache/struts/action/ActionMessagesorg/apache/struts/action目录下的ActionMessages类未定义,看看是不是少包或者包冲突或者没有加载完全或者其它错误
解决方案三:
java.lang.NoClassDefFoundError:org/apache/struts/action/ActionMessages你用的structs的jar包版本是多少?跟你Jboss里面的版本不一致,在WEB-INF目录下新建jboss-web.xml文件,文件内容如下:<!DOCTYPEjboss-webPUBLIC"-//JBoss//DTDWebApplication5.0//EN""http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"><jboss-web><!--Forloadclassindependently用来配置JBoss的classloader,避免class加载冲突--><class-loadingjava2ClassLoadingCompliance='true'><loader-repository>com.example:archive=test.war<loader-repository-config>java2ParentDelegaton=true</loader-repository-config></loader-repository></class-loading></jboss-web>这样在加载应用时,先加载应用中lib下的Jar注意NoClassDefFoundError跟ClassNotFound是完全不同的异常,前者是有java类但是版本冲突,后者是jar包缺失