spring 泛型配置
我在项目中用到了泛型,也主要是为了学习这方面知识,但是在配置SPRING的时候总是有错,请各位指点一下
下面是applicationContext-service.xml的配置
<?xml version="1.0" encoding="utf-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="baseTxProxy" lazy-init="true" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="create*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
</props>
</property>
</bean>
<bean id="accountInfo" class="com.abc.AccountInfo"></bean>
<bean id="accountInfoImpl" parent="baseTxProxy" class="com.abc.impl.AccountInfoImpl">
<constructor-arg><ref bean="accountInfo"/></constructor-arg>
<property name="hibernateTemplate" ref="hibernateTemplate"></property>
</bean>
<bean id="accountInfoAction" scope="prototype" class="com.abc.controller.AccountInfoAction">
<property name="accountInfoImpl">
<ref bean="accountInfoImpl"/>
</property>
</bean>
</beans>
下面是错误提示
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountInfoImpl' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes\com\dscver\xml\spring\applicationContext-service.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.Class]: Could not convert constructor argument value of type [com.abc.AccountInfo] to required type [java.lang.Class]: Failed to convert value of type [com.abc.AccountInfo] to required type [java.lang.Class]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [com.abc.AccountInfo] to required type [java.lang.Class]: no matching editors or conversion strategy found