解决项目启动报错:找不到类,Cannot find class

报错内容:

在开发Maven企业项目时,报错找不到某个类,报错内容:

Error creating bean with name ‘sqlSessionFactory’ defined in class
path resource [spring/spring-mybatis.xml]: Invocation of init method
failed; nested exception is
org.springframework.core.NestedIOException: Failed to parse mapping
resource:
‘file[D:\projects\tools\apache-tomcat-8.5.30\webapps\lixin_web\WEB-INF\classes\mapper\jieshaoMapper.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 ‘com.lixin.framework.beans.JieShao’. Cause:
java.lang.ClassNotFoundException: Cannot find class:
com.lixin.framework.beans.×××

解决办法:

1. 右击项目→Maven→Update Project
解决项目启动报错:找不到类,Cannot find class_第1张图片
2. 勾选报错的项目,勾选Force Update of Snapshots/Releases,点击OK
解决项目启动报错:找不到类,Cannot find class_第2张图片
3.重新启动项目试试

你可能感兴趣的:(SSM框架搭建,Maven,Mapper)