Orientdb: Java 9 compatibility

Created on 21 Sep 2016  Â·  8Comments  Â·  Source: orientechnologies/orientdb

A jdeps report lists a number of private API usages in orientdb, which will stop working in Java 9:

orientdb-core-2.2.8.jar
   com.orientechnologies.common.comparator (orientdb-core-2.2.8.jar)
      -> sun.misc                                           JDK internal API (rt.jar)
   com.orientechnologies.common.console (orientdb-core-2.2.8.jar)
      -> sun.misc                                           JDK internal API (rt.jar)
   com.orientechnologies.common.profiler (orientdb-core-2.2.8.jar)
      -> sun.misc                                           JDK internal API (rt.jar)
   com.orientechnologies.orient.core (orientdb-core-2.2.8.jar)
      -> sun.misc                                           JDK internal API (rt.jar)

orientdb-tools-2.2.8.jar
   com.orientechnologies.orient.console (orientdb-tools-2.2.8.jar)
      -> sun.misc                                           JDK internal API (rt.jar)
enhancement

Most helpful comment

Hi,

Already fixed with 3.0.0 and our continuous integration check java8 and java9 builds.

Closing.
Regards

All 8 comments

hi @trejkaz,

We are actually active testing on jdk9, all the reference to sun.misc are still working and as far as i understood will work even in jdk9, we where able to run most the test successfully on jdk9 but we had some troubles with JAXB+jigsaw.

In any case we have a plan to get rid of most of the 'sun.misc' references as soon as a valid alternative come out.

One point the testing of jdk9 is happen on develop brach, that will be 3.0, and the release 3.0 will be probaly the firt to guarantee the support of jdk9.

Regards

Hi @tglman
I have received the following log message when i run server.sh on JDK 9 and ODB 3.0M2 :

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
    at com.orientechnologies.orient.server.config.OServerConfigurationManager.<init>(OServerConfigurationManager.java:50)
    at com.orientechnologies.orient.server.OServer.startup(OServer.java:250)
    at com.orientechnologies.orient.server.OServer.startup(OServer.java:240)
    at com.orientechnologies.orient.server.OServerMain$1.run(OServerMain.java:46)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
    ... 4 more
Exception in thread "Thread-3" java.lang.NullPointerException
    at com.orientechnologies.orient.server.OServer.shutdown(OServer.java:449)
    at com.orientechnologies.orient.server.OServerShutdownHook.run(OServerShutdownHook.java:41)

java -version :

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

is there any update ?

Hi @tglman

Is it help to you?

xml <profile> <id>jigsaw</id> <activation> <!-- Java 9 doesn't identify itself as "1.9" but "9" --> <jdk>9</jdk> </activation> <properties> <additionalRuntimeArgLine>--add-modules java.xml.bind</additionalRuntimeArgLine> </properties> </profile>

hi @schernolyas,

This can be add but is an option only for jdk9 so it need some condition on the script boot based on the jdk version, as well all the third party that have orient as maven dependency should be aware of that, we are opting instead to remove the dependency of the jdk xml bind library and use a maven dependency, this is done in 3.x branch (not in 3.0.0-m2 will be next version).

@saeedtabrizi you can monitor the progress here: https://helios.orientdb.com/job/develop/job/orientdb-develop-openjdk-9/ we are not yet done but close to.

Regards

Hi,

3.0.0-m2 already support jdk9.

Regards

Hi,

Already fixed with 3.0.0 and our continuous integration check java8 and java9 builds.

Closing.
Regards

I ran jdeps on the 3.0 release and am still seeing internal API usage.

I assume all these are considered "OK until they remove it in a later version", or something to the effect? The "suggested replacement" goes to a JEP which doesn't actually describe a _replacement_, which is all a bit confusing to me.

orientdb-core-3.0.0.jar -> jdk.unsupported
   com.orientechnologies.common.comparator.OUnsafeByteArrayComparator -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.common.comparator.OUnsafeByteArrayComparator$1 -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.common.console.TTYConsoleReader -> sun.misc.Signal                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.common.console.TTYConsoleReader -> sun.misc.SignalHandler                             JDK internal API (jdk.unsupported)
   com.orientechnologies.common.console.TTYConsoleReader$1 -> sun.misc.Signal                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.common.console.TTYConsoleReader$1 -> sun.misc.SignalHandler                             JDK internal API (jdk.unsupported)
   com.orientechnologies.common.serialization.OUnsafeBinaryConverter -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.common.serialization.OUnsafeBinaryConverter$1 -> sun.misc.Unsafe                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.orient.core.OSignalHandler   -> sun.misc.Signal                                    JDK internal API (jdk.unsupported)
   com.orientechnologies.orient.core.OSignalHandler   -> sun.misc.SignalHandler                             JDK internal API (jdk.unsupported)
   com.orientechnologies.orient.core.OSignalHandler$OSignalListener -> sun.misc.Signal                                    JDK internal API (jdk.unsupported)

Warning: JDK internal APIs are unsupported and private to JDK implementation that are
subject to be removed or changed incompatibly and could break your application.
Please modify your code to eliminate dependence on any JDK internal APIs.
For the most recent update on JDK internal API replacements, please check:
https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool

JDK Internal API                         Suggested Replacement
----------------                         ---------------------
sun.misc.Signal                          See http://openjdk.java.net/jeps/260
sun.misc.SignalHandler                   See http://openjdk.java.net/jeps/260
sun.misc.Unsafe                          See http://openjdk.java.net/jeps/260

Hi , These APIs are not replaced yet in JDK itself. Probably in JDK 11 and
ODB we will use completely public API .

On Wed, Apr 18, 2018, 06:02 Trejkaz (pen name) notifications@github.com
wrote:

I ran jdeps on the 3.0 release and am still seeing internal API usage.

I assume all these are considered "OK until they remove it in a later
version", or something to the effect? The "suggested replacement" goes to a
JEP which doesn't actually describe a replacement, which is all a bit
confusing to me.

orientdb-core-3.0.0.jar -> jdk.unsupported
com.orientechnologies.common.comparator.OUnsafeByteArrayComparator -> sun.misc.Unsafe JDK internal API (jdk.unsupported)
com.orientechnologies.common.comparator.OUnsafeByteArrayComparator$1 -> sun.misc.Unsafe JDK internal API (jdk.unsupported)
com.orientechnologies.common.console.TTYConsoleReader -> sun.misc.Signal JDK internal API (jdk.unsupported)
com.orientechnologies.common.console.TTYConsoleReader -> sun.misc.SignalHandler JDK internal API (jdk.unsupported)
com.orientechnologies.common.console.TTYConsoleReader$1 -> sun.misc.Signal JDK internal API (jdk.unsupported)
com.orientechnologies.common.console.TTYConsoleReader$1 -> sun.misc.SignalHandler JDK internal API (jdk.unsupported)
com.orientechnologies.common.serialization.OUnsafeBinaryConverter -> sun.misc.Unsafe JDK internal API (jdk.unsupported)
com.orientechnologies.common.serialization.OUnsafeBinaryConverter$1 -> sun.misc.Unsafe JDK internal API (jdk.unsupported)
com.orientechnologies.orient.core.OSignalHandler -> sun.misc.Signal JDK internal API (jdk.unsupported)
com.orientechnologies.orient.core.OSignalHandler -> sun.misc.SignalHandler JDK internal API (jdk.unsupported)
com.orientechnologies.orient.core.OSignalHandler$OSignalListener -> sun.misc.Signal JDK internal API (jdk.unsupported)

Warning: JDK internal APIs are unsupported and private to JDK implementation that are
subject to be removed or changed incompatibly and could break your application.
Please modify your code to eliminate dependence on any JDK internal APIs.
For the most recent update on JDK internal API replacements, please check:https://wiki.openjdk.java.net/display/JDK8/Java+Dependency+Analysis+Tool

JDK Internal API Suggested Replacement
---------------- ---------------------
sun.misc.Signal See http://openjdk.java.net/jeps/260
sun.misc.SignalHandler See http://openjdk.java.net/jeps/260
sun.misc.Unsafe See http://openjdk.java.net/jeps/260

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/orientechnologies/orientdb/issues/6726#issuecomment-382237258,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAGaatmPPweb2kdevI5k_PAKJoOBEkFeks5tpqzOgaJpZM4KCQ8J
.

>

Best regards,
Andrey Lomakin, R&D lead.
OrientDB Ltd

twitter: @Andrey_Lomakin
linkedin: https://ua.linkedin.com/in/andreylomakin
blogger: http://andreylomakin.blogspot.com/

Was this page helpful?
0 / 5 - 0 ratings