2 qq 32498953 qq_32498953 于 2016.09.08 22:02 提问

[高分悬赏]SHH整合使用Struts2标签出现异常
  1. 添加了debug标签出现java.lang.NoSuchMethod异常!
 java.lang.NoSuchMethodError: com.opensymphony.xwork2.util.logging.Logger.debug(Ljava/lang/String;[Ljava/lang/Object;)V
    at org.apache.struts2.components.UIBean.populateComponentHtmlId(UIBean.java:992)
    at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:801)
    at org.apache.struts2.components.UIBean.end(UIBean.java:523)
    at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
    at org.apache.jsp.staff_jsp._jspx_meth_s_005fdebug_005f0(staff_jsp.java:202)
    at org.apache.jsp.staff_jsp._jspService(staff_jsp.java:162)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:149)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2517)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2506)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:619)
  1. 所有的jar包截图
    这是jar包

  2. 出现异常的类中具有该方法debug(Ljava/lang/String;[Ljava/lang/Object;)

方法
3. 并且会影响标签的包版本均一致

jar
4. web.xml中配置

 <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext*.xml</param-value>
    </context-param>
<filter>  
<filter-name>openSessionInView</filter-name>  
<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>  
</filter>  
<filter-mapping>  
<filter-name>openSessionInView</filter-name>  
<url-pattern>/*</url-pattern>  
</filter-mapping> 
<!--创建监听器 -->
<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

  <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
        org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
  </filter>
 <!--   <filter-mapping>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping> -->
  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

附上页面出错图
图片说明

这是我的项目
项目下载

6个回答

u010808544
u010808544   2016.09.13 14:22
已采纳

jar包冲突造成的,你换成xwork-2.1.2.jar重新启动项目就ok了

qq_31929931
qq_31929931   2016.11.02 08:58

logger包重复了,最后面有个V

qq_31929931
qq_31929931   2016.11.02 09:01

logger包重复了,最后面有个V

devmiao
devmiao   Ds   Rxr 2016.09.09 00:14
qq_32498953
qq_32498953   2016.09.09 08:54
  1. 楼主已经找了一个网上了!!!
ganyao939543405
ganyao939543405   2016.09.11 10:52

logger包不对 看看是不是log4j还是其他包 log包太多了,所有容易混

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!