In my project, I am using Spring Boot (spring-boot-starter-data-jpa) to access database. When I am trying to debug my application through Eclipse, I am getting a new IllegalArgumentException( "Not an managed type: " + cls ) from org.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType, and this exception only happens when I debug the application from Eclipse, so I tried to dig into it.
Here is what I found: Spring Boot scans the package looking for JPA entities, once it finds a class under the package has @Entity defined, it will go through all of its properties and trying to find if the property is a JPA entity type or not.
However, since most of those properties in the entity class are not a JPA entity type, so I get a lot of exception here, and because Eclipse by default will suspend the process once there is any exception happens in the code, this causes a lot of noises while debugging the application. It might be a good idea try to use different mechanism to check the property type here
Wenjie Zhang opened DATAJPA-891 and commented
In my project, I am using Spring Boot (spring-boot-starter-data-jpa) to access database. When I am trying to debug my application through Eclipse, I am getting a
new IllegalArgumentException( "Not an managed type: " + cls )
fromorg.hibernate.jpa.internal.metamodel.MetamodelImpl.managedType
, and this exception only happens when I debug the application from Eclipse, so I tried to dig into it.Here is what I found: Spring Boot scans the package looking for JPA entities, once it finds a class under the package has
@Entity
defined, it will go through all of its properties and trying to find if the property is a JPA entity type or not.The code is
However, since most of those properties in the entity class are not a JPA entity type, so I get a lot of exception here, and because Eclipse by default will suspend the process once there is any exception happens in the code, this causes a lot of noises while debugging the application. It might be a good idea try to use different mechanism to check the property type here
Backported to: 1.10.2 (Hopper SR2), 1.9.5 (Gosling SR5), 1.8.3 (Fowler SR3)
The text was updated successfully, but these errors were encountered: