java.lang.NoClassDefFoundError: org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity

Hibernate JIRA | Andrei Ivanov | 10 months ago
  1. 0

    Initially I had an entity with a basic property marked as lazy (didn't work at first, fixed in HHH-5255). The another entity was necessary, so I moved some common fields into an embeddable entity, but now the lazy basic property is loaded eagerly. {code:java} public class Entity { // this works @Basic(fetch = FetchType.LAZY) private String description; @Embedded private RecordData data; } @Embeddable public class RecordData { // this fails, it is loaded eagerly @Basic(fetch = FetchType.LAZY) @Lob private byte[] content; } {code} If you add a 2-nd field typed {{RecordData}} (as can be seen in my PR), an error in the bytecode enhancer is triggered: {noformat} java.lang.NoClassDefFoundError: org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity at org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.getAnnotatedClasses(LazyBasicFieldAccessTestTask.java:40) at org.hibernate.test.bytecode.enhancement.AbstractEnhancerTestTask.prepare(AbstractEnhancerTestTask.java:30) at org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.prepare(LazyBasicFieldAccessTestTask.java:47) at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils.runEnhancerTestTask(EnhancerTestUtils.java:98) at org.hibernate.test.bytecode.enhancement.EnhancerTest.testLazy(EnhancerTest.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.lang.ClassNotFoundException: org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask$Entity not found at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils$1.loadClass(EnhancerTestUtils.java:160) ... 16 more Caused by: java.lang.ClassFormatError: Duplicate interface name in class file org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils$1.loadClass(EnhancerTestUtils.java:157) ... 16 more {noformat}

    Hibernate JIRA | 10 months ago | Andrei Ivanov
    java.lang.NoClassDefFoundError: org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity
  2. 0

    Initially I had an entity with a basic property marked as lazy (didn't work at first, fixed in HHH-5255). The another entity was necessary, so I moved some common fields into an embeddable entity, but now the lazy basic property is loaded eagerly. {code:java} public class Entity { // this works @Basic(fetch = FetchType.LAZY) private String description; @Embedded private RecordData data; } @Embeddable public class RecordData { // this fails, it is loaded eagerly @Basic(fetch = FetchType.LAZY) @Lob private byte[] content; } {code} If you add a 2-nd field typed {{RecordData}} (as can be seen in my PR), an error in the bytecode enhancer is triggered: {noformat} java.lang.NoClassDefFoundError: org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity at org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.getAnnotatedClasses(LazyBasicFieldAccessTestTask.java:40) at org.hibernate.test.bytecode.enhancement.AbstractEnhancerTestTask.prepare(AbstractEnhancerTestTask.java:30) at org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.prepare(LazyBasicFieldAccessTestTask.java:47) at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils.runEnhancerTestTask(EnhancerTestUtils.java:98) at org.hibernate.test.bytecode.enhancement.EnhancerTest.testLazy(EnhancerTest.java:72) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: java.lang.ClassNotFoundException: org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask$Entity not found at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils$1.loadClass(EnhancerTestUtils.java:160) ... 16 more Caused by: java.lang.ClassFormatError: Duplicate interface name in class file org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.lang.ClassLoader.defineClass(ClassLoader.java:642) at org.hibernate.test.bytecode.enhancement.EnhancerTestUtils$1.loadClass(EnhancerTestUtils.java:157) ... 16 more {noformat}

    Hibernate JIRA | 10 months ago | Andrei Ivanov
    java.lang.NoClassDefFoundError: org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity
  3. 0

    New Event Factory Changes Issues

    GitHub | 2 years ago | Zidane
    com.google.common.util.concurrent.ExecutionError: java.lang.ClassFormatError: Duplicate method name&signature in class file org/spongepowered/api/event/impl/PlayerJoinEvent$Impl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Android Studio: White Space Formatting Strategy Factory error

    Stack Overflow | 2 years ago
    java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file com/intellij/psi/formatter/WhiteSpaceFormattingStrategyFactory
  6. 0

    Issue 183218 - android - Android studio startup error - Android Open Source Project - Issue Tracker - Google Project Hosting

    google.com | 1 year ago
    com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException

    13 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. java.lang.ClassFormatError

      Duplicate interface name in class file org/hibernate/test/bytecode/enhancement/lazy/basic/LazyBasicFieldAccessTestTask$Entity

      at java.lang.ClassLoader.defineClass1()
    2. Java RT
      ClassLoader.defineClass
      1. java.lang.ClassLoader.defineClass1(Native Method)
      2. java.lang.ClassLoader.defineClass(ClassLoader.java:760)
      3. java.lang.ClassLoader.defineClass(ClassLoader.java:642)
      3 frames
    3. org.hibernate.test
      EnhancerTest.testLazy
      1. org.hibernate.test.bytecode.enhancement.EnhancerTestUtils$1.loadClass(EnhancerTestUtils.java:157)
      2. org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.getAnnotatedClasses(LazyBasicFieldAccessTestTask.java:40)
      3. org.hibernate.test.bytecode.enhancement.AbstractEnhancerTestTask.prepare(AbstractEnhancerTestTask.java:30)
      4. org.hibernate.test.bytecode.enhancement.lazy.basic.LazyBasicFieldAccessTestTask.prepare(LazyBasicFieldAccessTestTask.java:47)
      5. org.hibernate.test.bytecode.enhancement.EnhancerTestUtils.runEnhancerTestTask(EnhancerTestUtils.java:98)
      6. org.hibernate.test.bytecode.enhancement.EnhancerTest.testLazy(EnhancerTest.java:72)
      6 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    5. JUnit
      FrameworkMethod.invokeExplosively
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      3 frames
    6. A Hibernate O/RM Module
      ExtendedFrameworkMethod.invokeExplosively
      1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45)
      1 frame
    7. JUnit
      FailOnTimeout$StatementThread.run
      1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      2. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      3. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
      3 frames