下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、Struts 在與 Spring 整合是要實現(xiàn) Struts 的 action 自動裝配到 spring 容器中,我們經(jīng)常遇到的問題是:java.lang.NullPointException 這個空指針異常,我碰到的有這么幾種解決方案:1.看一下你的 set 方法是否存在。2.是否在 web.xml 中配置了 “當 web 項目啟動的時候,讓 spring 掃描整個項目。 ”,當然也要加上一個名為:struts-spring-plugin*.jar的包,這個包實現(xiàn)了action裝配到 spring 的功能。(如果已經(jīng)加了這個包,也配置了 web.xml 還出現(xiàn)空指針異常,那么可能是你的 st
2、ruts-spring-plugin*.jar 的版本不配套, 還幾個版本試試)web.xml 中添加的配置(添加在 Struts 配置的前面):htmlview .springframework.web.context.ContextLoaderListener3.4.5.contextConfigLocation6.classpath:bean.xml7.當你已經(jīng)完成上面描述的配置的時候,還可能出現(xiàn)下面的這個異常,異常信息如下(這個是瀏覽器報的異常,后臺沒有異常,服務(wù)器啟動正常):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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度貨運司機安全責任協(xié)議書范本3篇
- 二零二五年度借唄個人消費貸款合同(藝術(shù)收藏品購買貸款版)4篇
- 二零二五個人債務(wù)額度擔保債務(wù)清理合同范本3篇
- 2025版消防工程設(shè)計合同范本(含消防咨詢)6篇
- 魚塘堤壩填筑施工方案
- 順德地毯清洗施工方案
- 二零二五版水電設(shè)備維護材料供應協(xié)議3篇
- 綠色出行服務(wù)提供合同
- 二零二五年度冷鏈物流送貨協(xié)議合同范本3篇
- 煙花購銷合同煙花爆竹合同
- 湖南高速鐵路職業(yè)技術(shù)學院單招職業(yè)技能測試參考試題庫(含答案)
- 英漢互譯單詞練習打印紙
- 2023湖北武漢華中科技大學招聘實驗技術(shù)人員24人筆試參考題庫(共500題)答案詳解版
- 一氯二氟甲烷安全技術(shù)說明書MSDS
- 母嬰護理員題庫
- 老年人預防及控制養(yǎng)老機構(gòu)院內(nèi)感染院內(nèi)感染基本知識
- SWITCH暗黑破壞神3超級金手指修改 版本號:2.7.6.90885
- 2023高考語文全國甲卷詩歌閱讀題晁補之《臨江仙 身外閑愁空滿眼》講評課件
- 物流簽收回執(zhí)單
- 鋼結(jié)構(gòu)廠房造價指標
- 安徽涵豐科技有限公司年產(chǎn)6000噸磷酸酯阻燃劑DOPO、4800噸磷酸酯阻燃劑DOPO衍生品、12000噸副產(chǎn)品鹽酸、38000噸聚合氯化鋁、20000噸固化劑項目環(huán)境影響報告書
評論
0/150
提交評論