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 10 problem with UIServer due to Play #5804

Closed
stolsvik opened this issue Jul 4, 2018 · 17 comments

Comments

Projects
None yet
7 participants
@stolsvik
Copy link
Contributor

commented Jul 4, 2018

Got bitten by something like this today - this issue discusses the problem:
jhalterman/typetools#34

It looked like this for me:

java.lang.NoClassDefFoundError: sun/reflect/ConstantPool
	at net.jodah.typetools.TypeResolver.populateLambdaArgs(TypeResolver.java:308)
	at net.jodah.typetools.TypeResolver.getTypeVariableMap(TypeResolver.java:254)
	at net.jodah.typetools.TypeResolver.resolveRawArguments(TypeResolver.java:162)
	at play.routing.RoutingDsl.with(RoutingDsl.java:182)
	at play.routing.RoutingDsl.access$000(RoutingDsl.java:66)
	at play.routing.RoutingDsl$PathPatternMatcher.build(RoutingDsl.java:362)
	at play.routing.RoutingDsl$PathPatternMatcher.routeTo(RoutingDsl.java:298)
	at org.deeplearning4j.ui.play.PlayUIServer.runMain(PlayUIServer.java:131)
	at org.deeplearning4j.ui.api.UIServer.getInstance(UIServer.java:27)
	at MyStuff.runNetwork(MyStuff.groovy:1035)
        ...
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:574)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:621)
	at com.stolsvik.machinelearning.tools.ExploratoryGroovyLooper$_loop_closure1.doCall(ExploratoryGroovyLooper.groovy:180)
	at com.stolsvik.machinelearning.tools.ExploratoryGroovyLooper$_loop_closure1.call(ExploratoryGroovyLooper.groovy)
	at groovy.lang.Closure.run(Closure.java:499)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: sun.reflect.ConstantPool
	at org.codehaus.groovy.tools.RootLoader.findClass(RootLoader.java:179)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
	at org.codehaus.groovy.tools.RootLoader.loadClass(RootLoader.java:151)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
	... 22 more

Aha! Link: https://skymindai.aha.io/features/DL4J-89

@AlexDBlack

This comment has been minimized.

Copy link
Member

commented Jul 5, 2018

This is probably not the only Java 9/10 support issue we'll encounter, so it's probably not enough to just fix this is isolation.

Another consideration is that fixing this will probably be done by upgrading Play framework for the UI - which means dropping scala 2.10 support (we use the last Play version that supports 2.10). Not sure if we're OK with that.

@stolsvik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 8, 2018

I guess you are painfully aware, but just to point it out anyway:
"End of Public Updates for Oracle JDK 8 -- Oracle will not post further updates of Java SE 8 to its public download sites for commercial use after January 2019."

So.. less than a half year, and counting down.

@raver119

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2018

That's not because Java 10 is so cool and important. That's because Java 11 goes out this autumn, and it'll be new LTS release for Java.

@agibsonccc

This comment has been minimized.

Copy link
Member

commented Jul 8, 2018

@stolsvik it doesn't matter right now..most libs still aren't supporting java 9+ yet. This will matter to us when businesses start actually upgrading their software, not hobbyists :). Individual devs always want the latest and greatest, it's not going to be worth it for us till the LTS.

There's a ton of effort that will go in to the upgrade, it's not just a switch for us. It's going to take us weeks of development to test this properly. We have to refactor the whole project structure and even after that there will still be tons of QA we have to do.

Jigsaw is going to be one of the most complicated upgrades we have done. Not to mention, we're still going to have to worry about our downstream dependencies upgrading. If this was a simple switch for us we would have did it long ago.

Remember, we use dl4j every day, you don't think we don't test these things?

It'd be foolish of us to actively prevent people from using the latest java for no reason, it turns out the world (as with anything) is slightly more complicated than that.

@stolsvik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2018

@agibsonccc Actually, I think you are too negative. I had your stuff working just fine, except for the UI which crashed due to an external dep. The jigsaw-stuff will, AFAIU, not be "enforced" in Java 11 either - with the standard JVM working pretty nicely.

@stolsvik

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2018

.. and btw, this is yet another good reason to keep the deps-list as small as possible (referring to an earlier issue where I brought up a quite extensive list..). Again, it seems to me like your own code isn't that problematic.

@agibsonccc

This comment has been minimized.

Copy link
Member

commented Jul 12, 2018

@stolsvik for us it's more about the support and the proper builds. I'm negative about us supporting newer javas till the LTS because it's a good chunk of time on our part to get right :). A few of us (including me) have tried using java 9 and it broke a ton. It was more headaches than it was worth and I don't want to claim we "support" it till we've actively worked with it. It's better than overpromising.

@saudet

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

@stolsvik BTW, feel free to send pull requests that gets stuff fixed. As long as it doesn't break under Java SE 7 or 8, that's good for us! We'll need it eventually.

@sascha08-15

This comment has been minimized.

Copy link

commented Oct 18, 2018

Since the current version is supposed to run with newer Java (9+) and even CUDA 10, I am inclined to ask if the UI part is expected to work as well. My latest test ended up with the same error "java.lang.NoClassDefFoundError: sun/reflect/ConstantPool" (working on SNAPSHOT)

@AlexDBlack

This comment has been minimized.

Copy link
Member

commented Oct 18, 2018

Since the current version is supposed to run with newer Java (9+) and even CUDA 10, I am inclined to ask if the UI part is expected to work as well.

CUDA 10, yes, that's supported now on snapshots.
Java 9 - where did you read that? We are not making any claims about java 9+ support anywhere (to the contrary, issues like this still exist).
Stick with Java 8 for now.

@saudet

This comment has been minimized.

Copy link
Member

commented Oct 18, 2018

Java 9+ should work just fine for most things, I've tested it out a bit, but some components like the UI do not.

@sascha08-15

This comment has been minimized.

Copy link

commented Oct 19, 2018

Since the current version is supposed to run with newer Java (9+) and even CUDA 10, I am inclined to ask if the UI part is expected to work as well.

CUDA 10, yes, that's supported now on snapshots.
Java 9 - where did you read that? We are not making any claims about java 9+ support anywhere (to the contrary, issues like this still exist).
Stick with Java 8 for now.

Not on any official channel. So I'd have to live with the issues for now. SNAPSHOT with Java 11 seems to work, however (except the UI part, as said).

@smagellan

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2018

@sascha08-15, try with overridden dependency:

<dependency>
        <groupId>net.jodah</groupId>
        <artifactId>typetools</artifactId>
        <version>0.5.0</version>
 </dependency>
@saudet

This comment has been minimized.

Copy link
Member

commented Dec 2, 2018

@smagellan If this fixes this issue, please send a pull request with that override included! Thanks

@saudet saudet self-assigned this Dec 2, 2018

@smagellan

This comment has been minimized.

Copy link
Contributor

commented Dec 2, 2018

@saudet, I was able to launch org.deeplearning4j.examples.convolution.Cifar example with override under Java 11, but I did not test override with entire library. Let's review and merge this: deeplearning4j/dl4j-examples#785, then I will switch to override.

michelole added a commit to bst-mug/n2c2 that referenced this issue Dec 4, 2018

Fix bug while running NN on JDK10+
On JDK10+, running the NNClassifier would result on a `java.lang.NoClassDefFoundError: sun/reflect/ConstantPool` message.

Add an overriden dependency as proposed on deeplearning4j/deeplearning4j#5804 (comment) to work around this issue while deeplearning4j 1.0.0 is not released.
@smagellan

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

@saudet, done: #6819

@AlexDBlack

This comment has been minimized.

Copy link
Member

commented Apr 26, 2019

@AlexDBlack AlexDBlack closed this Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.