Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 9 compatibility #6726

Closed
hakanai opened this issue Sep 20, 2016 · 8 comments
Closed

Java 9 compatibility #6726

hakanai opened this issue Sep 20, 2016 · 8 comments
Assignees

Comments

@hakanai
Copy link

hakanai commented Sep 20, 2016

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)
@lvca lvca added this to the 3.0 milestone Sep 22, 2016
@tglman
Copy link
Member

tglman commented Sep 26, 2016

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

@saeedtabrizi
Copy link
Contributor

saeedtabrizi commented Sep 2, 2017

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 ?

@schernolyas
Copy link

schernolyas commented Sep 3, 2017

Hi @tglman

Is it help to you?

<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>

@tglman
Copy link
Member

tglman commented Sep 4, 2017

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

@tglman
Copy link
Member

tglman commented Nov 17, 2017

Hi,

3.0.0-m2 already support jdk9.

Regards

@tglman
Copy link
Member

tglman commented Apr 17, 2018

Hi,

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

Closing.
Regards

@tglman tglman closed this as completed Apr 17, 2018
@hakanai
Copy link
Author

hakanai commented Apr 18, 2018

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

@andrii0lomakin
Copy link
Member

andrii0lomakin commented Apr 18, 2018 via email

@luigidellaquila luigidellaquila modified the milestones: 3.0.x, 3.0.1 May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

7 participants