报错内容
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionFactory’ defined in class path resource [Spring-Dao.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/Mybatis-Config.xml]
错误排查
最常见的问题是没有导入或者没有识别对应的配置文件
但是我导了
问题解决(加上"classpath:")
<!--配置Mybatis全局配置文件-->
<property name="configLocation" value="classpath:Mybatis-Config.xml"/>
在探索发现的时候发现了Spring部署报错:Could not open ServletContext resource [/jdbc.properties]
加上"classpath:",问题解决
路径这个东西到底还是不好搞