javax.persistence.EntityNotFoundException: Unable to find com.aa.TempTableEntity with id 0000019d-b151-4336-90a5-d41c499f7d30

Hibernate JIRA | Yervand Aghababyan | 5 months ago
  1. 0

    I had setup bytecode instrumentation to enable nullable lazy property loading for hibernate 4.3. After the migration to hibernate 5.2.1 the lazy loading behaviour seems to be broken. The configuration I have is: For instrumentation, I've disabled everything I could and only left the lazy loading instrumentation {code:xml|title:pom.xml} <plugin> <groupId>org.hibernate.orm.tooling</groupId> <artifactId>hibernate-enhance-maven-plugin</artifactId> <version>${hibernate.version}</version> <executions> <execution> <configuration> <failOnError>true</failOnError> <enableLazyInitialization>true</enableLazyInitialization> <enableDirtyTracking>false</enableDirtyTracking> <enableAssociationManagement>false</enableAssociationManagement> <enableExtendedEnhancement>false</enableExtendedEnhancement> </configuration> <goals> <goal>enhance</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>${jta.version}</version> </dependency> </dependencies> </plugin> {code} Entity containing the lazy loaded field {code:java|title=Lazy loaded field declaration} @Entity @Table("BLAH") class ContainsALazyNullableField { ... @OneToOne(fetch = FetchType.LAZY, optional = true) @LazyToOne(LazyToOneOption.NO_PROXY) @PrimaryKeyJoinColumn @LazyGroup("groupName") private TempTableEntity tempTableEntity; ... } {code} {code:java|title=Type of the lazy field} @Entity @Table(name = "TEMP_TABLE") public class TempTableEntity { @Id @Column(name = "LAZY_FIELD_CONTAINER_ID") private String lazyFieldContainerId; ... } {code} What I get is this: {code} javax.persistence.EntityNotFoundException: Unable to find com.aa.TempTableEntity with id 0000019d-b151-4336-90a5-d41c499f7d30 at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$JpaEntityNotFoundDelegate.handleEntityNotFound(EntityManagerFactoryBuilderImpl.java:157) at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227) at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:262) at org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121) at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89) at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1213) at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1096) at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639) at org.hibernate.type.EntityType.resolve(EntityType.java:431) at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:262) at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromDatastore(AbstractEntityPersister.java:1063) at org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:991) at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor$1.doWork(LazyAttributeLoadingInterceptor.java:105) at org.hibernate.bytecode.enhance.spi.interceptor.Helper.performWork(Helper.java:97) at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.loadAttribute(LazyAttributeLoadingInterceptor.java:76) at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.fetchAttribute(LazyAttributeLoadingInterceptor.java:72) at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.intercept(LazyAttributeLoadingInterceptor.java:61) at org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.readObject(LazyAttributeLoadingInterceptor.java:296) at com.aa.ContainsALazyNullableField.$$_hibernate_read_someOtherLazyField(ContainsALazyNullableField.java) at com.aa.ContainsALazyNullableField.getTempTableEntity(ContainsALazyNullableField.java:477) {code}

    Hibernate JIRA | 5 months ago | Yervand Aghababyan
    javax.persistence.EntityNotFoundException: Unable to find com.aa.TempTableEntity with id 0000019d-b151-4336-90a5-d41c499f7d30
  2. 0

    In a union-subclass mapping, how can the subclass declare required dependencies?

    Stack Overflow | 3 years ago | mabi
    javax.persistence.EntityNotFoundException: Unable to find my.company.Role with id 2
  3. 0

    Treat empty string in JoinColumn as null

    Stack Overflow | 2 years ago | g00glen00b
    javax.persistence.EntityNotFoundException: Unable to find org.example.entities.Function with id
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate ManyToOne mapping not on PKey

    Stack Overflow | 2 years ago | adept
    javax.persistence.EntityNotFoundException: Unable to find monitoring.reporter.entity.Host with id 35
  6. 0

    Remote Procedure Error when loggin only as admin

    GitHub | 2 years ago | joepr
    javax.persistence.EntityNotFoundException: Unable to find org.traccar.web.shared.model.Device with id 2

  1. MoYapro 4 times, last 3 weeks ago
  2. marcbouvierdav 71 times, last 2 months ago
  3. tfr 1 times, last 4 months ago
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.persistence.EntityNotFoundException

    Unable to find com.aa.TempTableEntity with id 0000019d-b151-4336-90a5-d41c499f7d30

    at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$JpaEntityNotFoundDelegate.handleEntityNotFound()
  2. org.hibernate.jpa
    EntityManagerFactoryBuilderImpl$JpaEntityNotFoundDelegate.handleEntityNotFound
    1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$JpaEntityNotFoundDelegate.handleEntityNotFound(EntityManagerFactoryBuilderImpl.java:157)
    1 frame
  3. Hibernate
    AbstractEntityPersister.initializeLazyProperty
    1. org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
    2. org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:262)
    3. org.hibernate.event.internal.DefaultLoadEventListener.doOnLoad(DefaultLoadEventListener.java:121)
    4. org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:89)
    5. org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1213)
    6. org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:1096)
    7. org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:639)
    8. org.hibernate.type.EntityType.resolve(EntityType.java:431)
    9. org.hibernate.type.EntityType.nullSafeGet(EntityType.java:262)
    10. org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyPropertiesFromDatastore(AbstractEntityPersister.java:1063)
    11. org.hibernate.persister.entity.AbstractEntityPersister.initializeLazyProperty(AbstractEntityPersister.java:991)
    11 frames
  4. org.hibernate.bytecode
    LazyAttributeLoadingInterceptor.readObject
    1. org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor$1.doWork(LazyAttributeLoadingInterceptor.java:105)
    2. org.hibernate.bytecode.enhance.spi.interceptor.Helper.performWork(Helper.java:97)
    3. org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.loadAttribute(LazyAttributeLoadingInterceptor.java:76)
    4. org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.fetchAttribute(LazyAttributeLoadingInterceptor.java:72)
    5. org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.intercept(LazyAttributeLoadingInterceptor.java:61)
    6. org.hibernate.bytecode.enhance.spi.interceptor.LazyAttributeLoadingInterceptor.readObject(LazyAttributeLoadingInterceptor.java:296)
    6 frames
  5. com.aa
    ContainsALazyNullableField.getTempTableEntity
    1. com.aa.ContainsALazyNullableField.$$_hibernate_read_someOtherLazyField(ContainsALazyNullableField.java)
    2. com.aa.ContainsALazyNullableField.getTempTableEntity(ContainsALazyNullableField.java:477)
    2 frames