Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseSer

xuyp95發表於2015-12-13

Struts Problem Report

Struts has detected an unhandled exception:

Messages:
  1. Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xuyp.managize.service.impl.ArticleServiceImpl] for property 'articleServiceImpl': no matching editors or conversion strategy found
  2. Failed to convert property value of type 'com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.xuyp.managize.service.impl.ArticleServiceImpl' for property 'articleServiceImpl'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xuyp.managize.service.impl.ArticleServiceImpl] for property 'articleServiceImpl': no matching editors or conversion strategy found
  3. Error creating bean with name 'articleAction' defined in file [D:\code\work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\HwManagize\WEB-INF\classes\applicationContext-beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.xuyp.managize.service.impl.ArticleServiceImpl' for property 'articleServiceImpl'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xuyp.managize.service.impl.ArticleServiceImpl] for property 'articleServiceImpl': no matching editors or conversion strategy found
  4. Unable to instantiate Action, articleAction, defined for 'article-list' in namespace '/'Error creating bean with name 'articleAction' defined in file [D:\code\work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\HwManagize\WEB-INF\classes\applicationContext-beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.xuyp.managize.service.impl.ArticleServiceImpl' for property 'articleServiceImpl'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy11 implementing com.xuyp.managize.service.IBaseService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.xuyp.managize.service.impl.ArticleServiceImpl] for property 'articleServiceImpl': no matching editors or conversion strategy found


初學SSH,碰到這個問題。一直不知道這是什麼錯誤,弄了大半天都沒弄懂。找了好久,看到了http://zhouhaitao.iteye.com/blog/852225這個博主的部落格,修改了applicationContext.xml 檔案中 aop 標籤中的 <aop:config  proxy-target-class>屬性  如下:
<span style="font-size:18px;"><aop:config  <span style="color:#ff0000;">proxy-target-class="true"</span>>
		<aop:pointcut expression="execution (* com.xuyp.managize.service.*.*(..))" id="pointcut"/>
		<aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut"/>
</aop:config></span>
修改之後 重啟伺服器即可


相關文章