Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User

Posted 学而时习之,不亦乐乎!!!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User相关的知识,希望对你有一定的参考价值。

错误

Error creating bean with name \'sqlSessionFactory\' defined in class path resource [spring-dao.xml]: Invocation of init method failed; 
nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource:
\'file [E:\\javaproject\\Demo11\\spring-01-hellospring\\spring-09-transaction\\target\\classes\\com\\kuang\\mapper\\UserMapper.xml]\';
nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is \'file
[E:\\javaproject\\Demo11\\spring-01-hellospring\\spring-09-transaction\\target\\classes\\com\\kuang\\mapper\\UserMapper.xml]
\'.
Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException:
Could not resolve type alias \'com.kuang.pojo.User\'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User

原因:实体类包的位置和sql映射文件没有正确对应

以上是关于Cause: java.lang.ClassNotFoundException: Cannot find class: com.kuang.pojo.User的主要内容,如果未能解决你的问题,请参考以下文章

ClassNotFoundException - com.mysql.jdbc.Driver / 导入 mysql-connector-java 后

从 PySpark 3.1.2 连接 Oracle DB - Py4JJavaError 失败

异常类Exception(String message, Throwable cause)中的cause理解

关于Json在SSh框架中出现的问题

### Cause: java.lang.reflect.UndeclaredThrowableException

mysql报错:Cause: com.mysql.jdbc.PacketTooBigException