我试图在我的春天项目中使用mybatis,但我想知道一件事情:是applicationContext需要任何配置来读取mybatis.xml?春天未能转换mybatis配置
这里是我的xml:
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.Ordering.Model" />
<property name="mapperLocations" value="classpath:mapper/*.xml" />
</bean>
如果我添加此配置:
<property name="configuration" value="classpath:mybatis/mybatis-config.xml" />
我会得到这个消息:
Failed to convert property value of type 'java.lang.String' to required type 'org.apache.ibatis.session.Configuration'
当我删除它,没有什么错误。我需要任何配置来转换mybatis.xml。
感谢。我使用'configLocation'而不是'configuration'并且它工作。 –