ssm框架报错: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis

在ssm框架项目中,项目挂载到Tomcat启动时报错,错误如下:

Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'QueryVo'.  Cause: java.lang.ClassNotFoundException: Cannot find class: QueryVo
	at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:103)
	at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:66)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:135)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:128)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:118)
	... 64 more
Caused by: org.apache.ibatis.type.TypeException: Could not resolve type alias 'QueryVo'.  Cause: java.lang.ClassNotFoundException: Cannot find class: QueryVo
	at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:117)
	at org.apache.ibatis.builder.BaseBuilder.resolveAlias(BaseBuilder.java:130)
	at org.apache.ibatis.builder.BaseBuilder.resolveClass(BaseBuilder.java:101)
	... 68 more
Caused by: java.lang.ClassNotFoundException: Cannot find class: QueryVo
	at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:190)
	at org.apache.ibatis.io.ClassLoaderWrapper.classForName(ClassLoaderWrapper.java:89)
	at org.apache.ibatis.io.Resources.classForName(Resources.java:256)
	at org.apache.ibatis.type.TypeAliasRegistry.resolveAlias(TypeAliasRegistry.java:113)
	... 70 more

这个是说实体类没有找到无法被加载,我们应该检查ssm的SqlMapConfig.xml配置文件是否设置了别名。如下图所示:
ssm框架报错: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis_第1张图片

这样在启动Tomcat就不会报错了。

你可能感兴趣的:(Javaweb)