我是靠谱客的博主 冷静魔镜,最近开发中收集的这篇文章主要介绍no matching editors or conversion strategy found 的解决办法,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
错误的具体情况如下:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'signInService' defined in ServletContext resource [/WEB-INF/applicationContext-beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy55 implementing com.moment.dao.userInfo.SignInDaoImpl,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.moment.dao.userInfo.SignInDao' for property 'signInDao'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy55 implementing com.moment.dao.userInfo.SignInDaoImpl,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.moment.dao.userInfo.SignInDao] for property 'signInDao': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:642)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:493)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4728)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5162)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3746)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:292)
at org.apache.catalina.core.StandardContext.backgroundProcess(StandardContext.java:5523)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1378)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1382)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1382)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1350)
at java.lang.Thread.run(Unknown Source)
额,贴上错误后看着,总觉得怪怪的,还是截图吧:
上面是错误,解决办法,很简单:
<aop:config proxy-target-class="true"> ,表示可以用类注入:
如我的配置文件:
<tx:advice transaction-manager="transactionManager" id="tm">
<tx:attributes>
<tx:method name="get*" read-only="true" propagation="REQUIRED"/>
<tx:method name="query*" read-only="true" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<aop:config proxy-target-class="true">
<aop:pointcut expression="execution(* com.moment.dao.*.*(..))" id="tp"/>
<aop:advisor advice-ref="tm" id="ta" pointcut-ref="tp"/>
</aop:config>
最后
以上就是冷静魔镜为你收集整理的no matching editors or conversion strategy found 的解决办法的全部内容,希望文章能够帮你解决no matching editors or conversion strategy found 的解决办法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复