本文主要是介绍The XML location is 'file [D:XXXXXX/mybatis-conf.xml] Cause: java.lang.NullPointerException,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
转自https://blog.csdn.net/private66/article/details/80990773
刚好犯了第二个原因的错误,放同一文件夹下了。。。
完整错误: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\workspace_java\sdk-kit-backend\target\classes\mapper\mybatis-conf.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\workspace_java\sdk-kit-backend\target\classes\mapper\mybatis-conf.xml]'. Cause: java.lang.NullPointerException
错误原因:一 .application.properties 中只配置了mapper.xml路径没有配置mybatis核心配置文件mybatis-conf.xml的路径
错误原因二:把mybatis核心配置文件写在了mapper.xml同一个的路径下
正确配置
这篇关于The XML location is 'file [D:XXXXXX/mybatis-conf.xml] Cause: java.lang.NullPointerException的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!