Could not resolve type alias‘Student‘.Cause:java.lang.ClassNotFoundException: not find class Student

问题:

Error building SqlSession.

The error may exist in com/kuang/dao/StudentMapper.xml

Cause: 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/kuang/dao/StudentMapper.xml’. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias ‘Student’. Cause: java.lang.ClassNotFoundException: Cannot find class: Student

解决方法:
在核心配置文件中配置:

<typeAliases>
        <typeAlias type="com.kuang.pojo.User" alias="User"/>
</typeAliases>

猜你喜欢

转载自blog.csdn.net/zhanlong11/article/details/115121303