267 words

Enhancer failure: Failed to process class file of type

#1
2017-10-29 00:57
Stack trace below:

 

[ObjectDB 2.7.1_02] Failed to process class file of type 'app.model.ClientSession' (error 422)
com.objectdb.o.UserException: Failed to process class file of type 'app.model.ClientSession'
        at com.objectdb.o.MSG.d(MSG.java:75)
        at com.objectdb.o.JEL.A(JEL.java:446)
        at com.objectdb.o.JEN.m(JEN.java:101)
        at com.objectdb.Enhancer.main(Enhancer.java:33)
Caused by: com.objectdb.o.UserException: Failed to generate dynamic type jdk.internal.reflect.SerializationConstructorAccessorImpl
        at com.objectdb.o.MSG.d(MSG.java:75)
        at com.objectdb.o.ACL.d(ACL.java:167)
        at com.objectdb.o.BCL.loadClass(BCL.java:59)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1173)
        at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
        at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400)
        at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
        at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:112)
        at java.base/jdk.internal.reflect.ReflectionFactory.generateConstructor(ReflectionFactory.java:434)
        at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:426)
        at java.base/java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1516)
        at java.base/java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:81)
        at java.base/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:509)
        at java.base/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:484)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.base/java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:484)
        at java.base/java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:381)
        at java.base/java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:225)
        at com.objectdb.o.TDF.<init>(TDF.java:194)
        at com.objectdb.o.ANT.V(ANT.java:874)
        at com.objectdb.o.SCM.r(SCM.java:304)
        at com.objectdb.o.SCM.r(SCM.java:207)
        at com.objectdb.o.JEW.aG(JEW.java:185)
        at com.objectdb.o.JEL.A(JEL.java:436)
        ... 2 more
Caused by: com.objectdb.o.UserException: Failed to generate dynamic type jdk.internal.reflect.ConstructorAccessorImpl
        at com.objectdb.o.MSG.d(MSG.java:75)
        at com.objectdb.o.ACL.d(ACL.java:167)
        at com.objectdb.o.BCL.loadClass(BCL.java:59)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:868)
        at com.objectdb.o.ACL.d(ACL.java:155)
        ... 28 more
Caused by: java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by com/objectdb/o/BCL cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:868)
        at com.objectdb.o.ACL.d(ACL.java:155)
        ... 34 more


FAILURE: Build failed with an exception.
dmoshal
dmoshal's picture
Joined on 2010-05-22
User Post #124
#2
2017-10-29 10:43

If you switched to Java 9 then you need ObjectDB 2.7.2 or above.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,870
#3
2017-10-29 18:03

thanks, that explains what happened, I ran gradle from the command line, which is using Java 9, and got the error.

By my IntelliJ IDE is using java 8 and doesn't have the error.

 

Thanks

David

dmoshal
dmoshal's picture
Joined on 2010-05-22
User Post #125
#4
2017-10-29 18:27

comfirmed that error resolved with 2.7.2_02

and the following enhancement config in gradle works:

task enhance ( type: JavaExec ) {
  main = 'com.objectdb.Enhancer'
  classpath = sourceSets.main.runtimeClasspath
  args '-cp', 'src/main/groovy', 'app.framework.AuEntity', 'app.model.*'
}
compileGroovy.finalizedBy ( enhance )

You might want to add a note somewhere for folks using Gradle, because this is a very easy way to add enhancement to the the build process.

dmoshal
dmoshal's picture
Joined on 2010-05-22
User Post #126
#5
2017-10-30 13:05

Thanks

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,872

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel