报错信息:org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [config/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [D:\apache-tomcat-9.0.17\webapps\Hhotel\WEB-INF\classes\com\hnkjxy\hotel\dao\admin\AuthorityDao.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘Authority’. Cause: java.lang.ClassNotFoundException: Cannot find class: Authority
我出现这个错误的原因是我用了之前的数据库文件,在数据库里面有路径,我没有改项目的路径,所以报错,我修改了路径后错误解决。
org.springframework.beans.factory.BeanCreationException
最新推荐文章于 2025-02-11 14:24:19 发布
本文详细解析了一个关于MyBatis配置文件中路径错误的问题,作者在使用Spring框架整合MyBatis时,由于数据库文件路径与项目路径不匹配导致初始化Bean失败。通过调整路径设置,成功解决了这一技术难题。
2395

被折叠的 条评论
为什么被折叠?



