整合spring mvc与mybatis时出现了war包加载失败,程序无法运行的情况。

作为萌新的我,今天我在整合spring mvc与mybatis时,我将上个mybatis项目里的dao,mapper,service复制过来之后发现我的上个项目的模型的包名为modle,而本项目中的包名为model,所以出现了许多报错,随后我把报错的地方引用的包名修改后运行,发现war包启动失败,程序无法启动。
整合spring mvc与mybatis时出现了war包加载失败,程序无法运行的情况。
随后我就百度问题解决,随后发现了一个帖子说他看Tomcat Localhost Log自己的代码有错误
整合spring mvc与mybatis时出现了war包加载失败,程序无法运行的情况。
然后我就看我的Tomcat Localhost Log发现了这样一行错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis-config.xml]; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is ‘com/llb/ssm/user/mapper/UserMapper.xml’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘com.llb.ssm.user.modle.User’. Cause: java.lang.ClassNotFoundException: Cannot find class: com.llb.ssm.user.modle.User
然后我就去我的UserMapper.xml查看错误发现
整合spring mvc与mybatis时出现了war包加载失败,程序无法运行的情况。
这里的包名还为modle,我还没有改正,我把modle改成model后再运行,成功运行。所以如果遇到和我一样错误的学习者们,先去检查代码的错误哦。同时也谢谢那位百度帖子的老哥。