问答详情
源自:3-3 datasource和sessionfactorybean的配置

sqlSessionFactory总是报错!

2021-02-22 12:10:57.907  WARN 24824 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: 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.io.FileNotFoundException: Could not open ServletContext resource [/mybatis-config.xml]


提问者:qq_慕神9507294 2021-02-22 12:14

个回答

  • 慕仰4505877
    2021-09-10 16:34:01

     Could not open ServletContext resource [/mybatis-config.xml]  看下配置信息是否配置有问题