Error creating bean with name 'sqlSessionFactory' defined in class path resource

今天做mybatis与spring整合的时候报了一个错误,如下

Caused by: org.springframework.beans.factory.BeanCreationException: 

Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: 

Cannot resolve reference to bean 'mapper/mybatis.xml' while setting bean property 'configLocation'; 

nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'mapper/mybatis.xml' is defined

英文不太好,大体理解了一下,好像是说在[spring-mybatis.xml中注册configLocation的地方有错



ref="mapper/mybatis.xml"
>

仔细检查了一下代码,发现还真是有错,唉,正确的代码如下




你可能感兴趣的:(项目搭建)