Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cannot resolve reference to bean 'factory' while setting bean property 'sqlSessionFactory'; nested excep

时间:2022-02-19 08:56:08

Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cannot resolve reference to bean 'factory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'factory' defined in class path resource [applicationcontext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dateSource' of bean class [org.mybatis.spring.SqlSessionFactoryBean]: Bean property 'dateSource' is not writable or has an invalid setter method. Did you mean 'd

 

有可能是之前设置了别名标签,在将mybatis整合到spring的时候没有设置别名标签,所以才会报错,这时候就要写全路径了

Error creating bean with name 'mapper' defined in class path resource [applicationcontext.xml]: Cannot resolve reference to bean 'factory' while setting bean property 'sqlSessionFactory'; nested excep