-
具体报错如下:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method ‘sqlSessionFactory’ threw exception; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -31 -
原因:
父工程和子工程中同时存在mybatis的相关依赖包,因为依赖包冲突从而引起这个报错。
3 解决:
将父工程中的mybatis的相关依赖包移除。
本文详细解析了在Spring框架下,由于父工程和子工程中同时存在MyBatis相关依赖包导致的BeanCreationException错误。通过分析错误原因,提供了解决方案,即移除父工程中的MyBatis依赖包,以避免依赖冲突。
2663





