JPA项目启动 Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.**

原创

异常:

org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.*

Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.*

解决:

1.检查实体类上是否添加注解

  @entity 和 @table

2. 定义包扫描注解 实体与数据库表的映射关系 ,扫描实体类的配置路径是否正确

<property name="packagesToScan" value="包名" />

 

 

正文到此结束