412 words

ObjectDB Enhancer Tool in Java 9

#1
2017-10-07 19:52

I am migrating to Java 9 and have encountered some issues, which I am sure will eventually be addressed by a Java 9 compatible ObjectDB future release, but while waiting for that release, perhaps you could give some advice for my current issues.

Firstly, I created my own ObjectDB module.  I try to run com.objectdb.Enhancer from that module, but ObjectDB gives the error below.  My guess is the error is because ObjectDB is trying to detect its objectdb.home location by looking at its objectdb.jar location, which is not valid in a Java module environment.

Example command:

java -Dobjectdb.conf=ObjectDb.conf --module-path com.objectdb.jar --module com.objectdb/com.objectdb.Enhancer

Command output:

com.objectdb.o.UserException: Configuration is not found - try setting objectdb.conf
 
at com.objectdb/com.objectdb.o.MSG.d(MSG.java:62)
at com.objectdb/com.objectdb.o.CFG.<clinit>(CFG.java:54)
at com.objectdb/com.objectdb.o.JEN.<init>(JEN.java:67)
at com.objectdb/com.objectdb.Enhancer.main(Enhancer.java:32)
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.objectdb/com.objectdb.o.JEN.<init>(JEN.java:67)
at com.objectdb/com.objectdb.Enhancer.main(Enhancer.java:32)
Caused by: com.objectdb.o.UserException: Invalid configuration in 'internal' - Check permissions.
at com.objectdb/com.objectdb.o.MSG.d(MSG.java:75)
at com.objectdb/com.objectdb.o.CFG.<clinit>(CFG.java:61)
... 2 more
Caused by: com.objectdb.o.UserException: Configuration is not found - try setting objectdb.conf
at com.objectdb/com.objectdb.o.MSG.d(MSG.java:62)
at com.objectdb/com.objectdb.o.CFG.<clinit>(CFG.java:54)
... 2 more

 

 

So I decided I would just make the call from the original object.jar instead of my self created Java module of its contents.  This lead to my current issue.  I have been unable to resolve this issue.  I have tried all sorts of Java workarounds with no luck.  (For example, --add-exports, --add-opens, etc.)

Example command:

java -Dobjectdb.conf=ObjectDb.conf --class-path objectdb.jar;MyDir com.objectdb.Enhancer com.mystuff.*

Command output:

[ObjectDB 2.7.1_09] Failed to process class file of type 'com.unilogical.moxydox.server.Email' (error 422)
com.objectdb.o.UserException: Failed to process class file of type 'com.unilogical.moxydox.server.Email'
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:1417)
at java.base/java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:75)
at java.base/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:500)
at java.base/java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:475)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:475)
at java.base/java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:372)
at java.base/java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:216)
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:224)
at com.objectdb.o.JEW.aI(JEW.java:310)
at com.objectdb.o.JEW.aH(JEW.java:261)
at com.objectdb.o.JEW.aH(JEW.java:224)
at com.objectdb.o.JEW.aG(JEW.java:188)
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)
... 30 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)
... 36 more

 

Answering the first question is just a bonus.  The second issue is the one I really need to resolve.  Otherwise I guess my only recourse is to also install Java 8 and use it just to run ObjectDB's Enhancer.

 

Thank you for any insights you may offer! 

BoydEdmondson
BoydEdmondson's picture
Joined on 2016-07-08
User Post #59
#2
2017-10-07 20:11

Oh, jdk.unsupported in available in my module path (and proven with --list-modules option).

BoydEdmondson
BoydEdmondson's picture
Joined on 2016-07-08
User Post #60
#3
2017-10-08 21:38

Please see this update regarding support of Java 9.

It should solve your 2nd issue but not the 1st (the module and the configuration) yet.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
support
support's picture
Joined on 2010-05-03
User Post #2,843
#4
2017-10-08 21:52

ObjectDB 2.7.2 update did indeed solve issue 2) above.  (Thanks!)

I will consider this posting closed and instead track issue 1197.

BoydEdmondson
BoydEdmondson's picture
Joined on 2016-07-08
User Post #61

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