问题描述
Unabletoloadbeanorg.apache.struts2.dispatcher.multipart.MultiPartRequest()-[unknownlocation][下面是具体的控制台信息]2015-2-519:41:24org.apache.catalina.core.StandardWrapperValveinvoke严重:Servlet.service()forservletdefaultthrewexceptionjava.lang.RuntimeException:Unabletoloadbeanorg.apache.struts2.dispatcher.multipart.MultiPartRequest()-[unknownlocation]atcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:514)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:524)atcom.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:555)atcom.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584)atcom.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:553)atorg.apache.struts2.dispatcher.Dispatcher.getMultiPartRequest(Dispatcher.java:803)atorg.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:777)atorg.apache.struts2.dispatcher.ng.PrepareOperations.wrapRequest(PrepareOperations.java:134)atorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:83)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:96)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.omw.dc.system.filter.LoginFilter.doFilter(LoginFilter.java:49)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:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)atjava.lang.Thread.run(Thread.java:662)Causedby:Unabletoloadbeanorg.apache.struts2.dispatcher.multipart.MultiPartRequest()-[unknownlocation]atorg.apache.struts2.config.BeanSelectionProvider$ObjectFactoryDelegateFactory.create(BeanSelectionProvider.java:467)atcom.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)...28more
查了一些资料,大都说是jar包应包含以下几个jar包:commons-logging-1.1.jarfreemarker-2.3.8.jarognl-2.6.11.jarstruts2-core-2.0.6.jarxwork-2.0.1.jarcommons-io-1.3.1.jarcommons-fileupload-1.2.jar经过比对,这些jar包都有,只是版本不同。将所有jar包统一替换成最新版本问题仍然存在。纠结许久,无奈求请援手。希望有前辈可以指点一下,谢谢。
解决方案
解决方案二:
[其他相关代码]<formid="myform"name="myform"action="${ctxPath}/common/upload-uploadFile.do"method="post"enctype="multipart/form-data"onsubmit="returnupload();"><inputtype="file"name="uploadfile"id="uploadfile"/><inputtype="submit"id="upload"value="上传"/></form>
functionupload(){$("#myform").ajaxSubmit(function(message){alert(message);});returnfalse;}
<filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping><filter-name>struts2</filter-name><url-pattern>*.do</url-pattern></filter-mapping><filter-mapping><filter-name>struts2</filter-name><url-pattern>/struts/*</url-pattern></filter-mapping>
解决方案三:
把struts.xml贴出来看看
解决方案四:
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstrutsPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration2.0//EN""http://struts.apache.org/dtds/struts-2.0.dtd"><struts><packagename="common"extends="struts-default"><interceptors><interceptorname="encoding"class="com.omw.dc.common.action.interceptor.EncodingInterceptor"></interceptor><interceptorname="security"class="com.omw.dc.common.action.interceptor.SecurityInterceptor"></interceptor><interceptor-stackname="commonStack"><interceptor-refname="encoding"></interceptor-ref><interceptor-refname="security"></interceptor-ref><interceptor-refname="defaultStack"></interceptor-ref></interceptor-stack></interceptors><default-interceptor-refname="commonStack"></default-interceptor-ref><default-action-refname="common"/><global-results><resultname="exception"type="chain">extException</result><resultname="accessDenie">/common/access_denie.jsp</result></global-results><global-exception-mappings><exception-mappingresult="exception"exception="java.lang.Exception"></exception-mapping></global-exception-mappings><actionname="common"><result>/WEB-INF/success.jsp</result></action><actionname="login-*"class="loginAction"method="{1}"><resultname="login">/WEB-INF/jsp/login.jsp</result><resultname="success"type="redirect">/common/index.do</result><resultname="error">/WEB-INF/jsp/login.jsp</result></action><actionname="index"class="indexAction"method="index"><result>/WEB-INF/jsp/main.jsp</result></action><actionname="desktop-*"class="indexAction"method="{1}"><result>/WEB-INF/jsp/desktop/desktop_{1}.jsp</result></action><actionname="upload-*"class="fileUploadAction"method="{1}"><result>/WEB-INF/jsp/desktop/desktop_{1}.jsp</result></action></package><includefile="struts_mail.xml"/><includefile="struts_mydoc.xml"/></struts>
解决方案五:
顶起!!!!!!!!!