![Struts的action自动装配到spring_第1页](http://file3.renrendoc.com/fileroot_temp3/2022-1/22/cefba9ba-182e-43b4-8203-5a3f5ed83105/cefba9ba-182e-43b4-8203-5a3f5ed831051.gif)
![Struts的action自动装配到spring_第2页](http://file3.renrendoc.com/fileroot_temp3/2022-1/22/cefba9ba-182e-43b4-8203-5a3f5ed83105/cefba9ba-182e-43b4-8203-5a3f5ed831052.gif)
![Struts的action自动装配到spring_第3页](http://file3.renrendoc.com/fileroot_temp3/2022-1/22/cefba9ba-182e-43b4-8203-5a3f5ed83105/cefba9ba-182e-43b4-8203-5a3f5ed831053.gif)
![Struts的action自动装配到spring_第4页](http://file3.renrendoc.com/fileroot_temp3/2022-1/22/cefba9ba-182e-43b4-8203-5a3f5ed83105/cefba9ba-182e-43b4-8203-5a3f5ed831054.gif)
![Struts的action自动装配到spring_第5页](http://file3.renrendoc.com/fileroot_temp3/2022-1/22/cefba9ba-182e-43b4-8203-5a3f5ed83105/cefba9ba-182e-43b4-8203-5a3f5ed831055.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Struts 在与 Spring 整合是要实现 Struts 的 action 自动装配到 spring 容器中,我们经常遇到的问题是:java.lang.NullPointException 这个空指针异常,我碰到的有这么几种解决方案:1.看一下你的 set 方法是否存在。2.是否在 web.xml 中配置了 “当 web 项目启动的时候,让 spring 扫描整个项目。 ”,当然也要加上一个名为:struts-spring-plugin*.jar的包,这个包实现了action装配到 spring 的功能。(如果已经加了这个包,也配置了 web.xml 还出现空指针异常,那么可能是你的 st
2、ruts-spring-plugin*.jar 的版本不配套, 还几个版本试试)web.xml 中添加的配置(添加在 Struts 配置的前面):htmlview .springframework.web.context.ContextLoaderListener3.4.5.contextConfigLocation6.classpath:bean.xml7.当你已经完成上面描述的配置的时候,还可能出现下面的这个异常,异常信息如下(这个是浏览器报的异常,后台没有异常,服务器启动正常):plainview plaincopy1.Struts Problem Rep
3、ort2.3.Struts has detected an unhandled exception:4.5.Messages:6.Cannot convert value of type xy.$Proxy8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImpl
4、for property userServiceImpl: no matchi ngeditors or conversion strategy found7.Failed to convert property value of type xy.$Proxy8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.s
5、erviceimpl.UserServiceImpl for property userServiceImpl ;nested exception is java.lang.IllegalArgumentException: Cannot conv ertvalue of type xy.$Proxy8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required
6、 type com.zsq.wxssh.serviceimpl.UserServiceImpl for property userServiceImpl: no matchingeditors or conversion strategy found8.Unable to instantiate Action, com.zsq.wxssh.action.LoginAction, define d for Login in namespace /Failed toconvert property value of type xy.$Proxy8 implementingco
7、m.zsq.wxssh.service.UserService ,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImplfor property userServiceImpl; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type xy.$P
8、roxy8implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advisedype com.zsq.wxssh.serviceimpl.UserServiceImpl for property userServiceImpl: no matching editors or conversion strategy found9.File: org/springframework/beans/TypeConverter
9、Delegate.java10.Line number: 23111.Stacktraces12.13.Unable to instantiate Action, com.zsq.wxssh.action.LoginAction, define d for Login in namespace /Failed toconvert property value of type xy.$Proxy8 implementingcom.zsq.wxssh.service.UserService ,org.springframework.aop.SpringProxy,org.sp
10、ringframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImplfor property userServiceImpl; nested exception is java.lang.Illegalto required tArgumentException: Cannot convert value of type xy.$Proxy8implementing com.zsq.wxssh.service.UserService,org.spring
11、framework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImpl for property userServiceImpl: no matching editors or conversion strategy .opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:316).opensymp
12、hony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:397).opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)17.org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)18.org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(S
13、trutsActionProxyFactory.java:39).opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)20.org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)21.org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:
14、77)22.org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)23.org.apache.catalina.core.ApplicationFilterCernalDoFilter(ApplicationFilterChain.java:235)24.org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
15、Chain.java:206)25.org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)26.org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)27.org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)28.org.apache.catalina.valves.Err
16、orReportValve.invoke(ErrorReportValve.java:103)29.org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)30.org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)31.org.apache.coyote.http11.Http11AprPcess(Http11AprProcessor.java:879)32.org.a
17、pache.coyote.http11.Http11AprProtocol$Http11ConnectionHcess(Http11AprProtocol.java:600).AprEndpoint$Worker.run(AprEndpoint.java :1703)34.java.lang.Thread.run(Thread.java:724)35.36.org.springframework.beans.TypeMismatchException: Failed to convert property value of type xy.$Proxy
18、8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImpl for property userServiceImpl; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type
19、 xy.$Proxy8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImpl forproperty userServiceImpl: no matching editors or conversion strategy .springfra
20、mework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)38.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)39.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.app
21、lyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)40.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)41.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperti
22、es(AbstractAutowireCapableBeanFactory.java:329).opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:203).opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:183).opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactor
23、y.java:154).opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151).opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:121).opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:297).opensymphony.xwork2.DefaultActionInvocation.init(DefaultAct
24、ionInvocation.java:397).opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)50.org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)51.org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39).opensymphony.xwork
25、2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)53.org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)54.org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)55.org.apache.struts2.dispatcher.ng.filter.Strut
26、sPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)56.org.apache.catalina.core.ApplicationFilterCernalDoFilter(ApplicationFilterChain.java:235)57.org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)58.org.apache.catalina.core.Standard
27、WrapperValve.invoke(StandardWrapperValve.java:233)59.org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)60.org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)61.org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)62.o
28、rg.apache.catalina.core.StandardEngineValve.invoke(StandardE.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)64.org.apache.coyote.http11.Http11AprPcess(Http11AprProcessor.java:879)65.org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHc
29、ess(Http11AprProtocol.java:600).AprEndpoint$Worker.run(AprEndpoint.java :1703)67.java.lang.Thread.run(Thread.java:724)68.69.java.lang.IllegalArgumentException: Cannot convert value of type xy.$Proxy8 implementing com.zsq.wxssh.service.UserService,org.springframework.aop.SpringProxy,org.sp
30、ringframework.aop.framework.Advised to required type com.zsq.wxssh.serviceimpl.UserServiceImpl for p ropertyuserServiceImpl: no matching editors or conversion strategy .springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)71.org.springframework.bea
31、ns.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)72.org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)73.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.ja
32、va:1289)74.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)75.org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)76.org.sp
33、ringframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBeanProperties(AbstractAutowireCapableBeanFactory.java:329).opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:203).opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFa
34、ctory.java:183).opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154).opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151).opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:121).opensymphony.xwork2.DefaultActionInvocation.createAction(De
35、faultActionInvocation.java:297).opensymphony.xwork2.DefaultActionInvocation.init(DefaultA.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:194)85.org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:63)86.org.apache.struts2.impl.StrutsActionProxyFactory.crea
36、teActionProxy(StrutsActionProxyFactory.java:39).opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:58)88.org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:553)89.org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteO
37、perations.java:77)90.org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)91.org.apache.catalina.core.ApplicationFilterCernalDoFilter(ApplicationFilterChain.java:235)92.org.apache.catalina.core.ApplicationFilterChain.doFilter(Ap
38、plicationFilterChain.java:206)93.org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)94.org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)95.org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)96.org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportV
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 合法的金融借款合同
- 出租房租赁合同协议
- 用于经营的房屋租赁合同
- 大数据风控服务合同
- 汽车租赁书面合同书
- 联保借款标准合同
- 2025小麦购销合同样本
- 个人借款合同合同英文范本
- 提升销售技巧的培训课程
- 2024年5G通信基础设施建设合同
- 2025年护士资格考试必考基础知识复习题库及答案(共250题)
- 2025年人教版PEP二年级英语上册阶段测试试卷
- 烟草业产业链协同创新模式-洞察分析
- 经济学基础试题及答案 (二)
- 2024-2030年中国蚝肉市场发展前景调研及投资战略分析报告
- 化工企业静电安全检查规程
- 宁骚公共政策学完整版笔记
- 2023年湖南高速铁路职业技术学院高职单招(数学)试题库含答案解析
- 勇者斗恶龙9(DQ9)全任务攻略
- 经颅磁刺激的基础知识及临床应用参考教学课件
- 小学语文人教四年级上册第四单元群文阅读“神话故事之人物形象”PPT
评论
0/150
提交评论