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>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值