关于ibatis和spring的applicationContext.xml整合
这是applicationContext.xml的配置
<beans>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver">
</property>
<property name="url"
value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=test">
</property>
<property name="username" value="sa"></property>
<property name="password" value="123"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="configLocation" value="classpath:sqlMapConfig.xml"></property>
</bean>
<import resource="springs/DBspring.xml"/>
</beans>
这是被引入的DBspring.xml配置
<beans>
<bean id="dao" class="dao.sqldao.BaseDao">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="idao" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" value="dao.sqlclients.IbaseDao">
</property>
<property name="target">
<ref bean="dao"/>
</property>
</bean>
</beans>
然后它报了这样的错误,求大神们指点
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in ServletContext resource [/WEB-INF/classes/springs/DBspring.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [dao.sqldao.BaseDao]: Bean property 'sessionFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
at java.security.AccessController.doPrivileged(Native Method)