Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 3.7 and Java 11 Support(Which versions of Java are supported with which RAP versions?)
RAP 3.7 and Java 11 Support [message #1801734] Fri, 25 January 2019 11:46 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 261
Registered: November 2012
Location: UK
Senior Member
Trying to run a RAP 3.7 application WAR inside FireFly 15.0.1 with various versions of Java on Windows 7 64-bit, and running into problems with any Java version beyond JDK8 (Oracle or an OpenJDK build).

What versions of Java should I expect a RAP 3.7 application to work with?

JDK8 64-bit: OK
AdoptOpenJDK8 64-bit: OK
OpenJDK9 64-bit: ERROR
JDK11 64-bit: ERROR
I've tried various other versions too, and the common factor seems to be moving beyond JDK8.

The issue I see is in resource handling and ClassLoader usage, with the pertinent part of the exception being:
2019-01-25 15:33:07,028 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /<myapp>/<mycontext>: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')


This is in calling:
URLClassLoader pcl = (URLClassLoader)ClassLoader.getSystemClassLoader();


Is this a RAP-support issue, or something I can workaround in my code by changing the way I deal with the ClassLoader? The only difference is changing from Java8 to something newer?

I want to continue to compile my code using Java8.

Thanks, John


---
Just because you can doesn't mean you should
Re: RAP 3.7 and Java 11 Support [message #1801735 is a reply to message #1801734] Fri, 25 January 2019 11:59 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2327
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi John,
just tried our Controls Demo with OpenJDK 11.0.1 under windows and everything is working fine. Tried with JDK 10.0.2 as well.
During the development I'm testing our demos with the most recent JDK/OpenJDK in my daily basis.

I can't find in RAP sources the mentioned code:
URLClassLoader pcl = (URLClassLoader)ClassLoader.getSystemClassLoader();
Where this code is used?

Best regards,
Ivan
Re: RAP 3.7 and Java 11 Support [message #1801745 is a reply to message #1801735] Fri, 25 January 2019 15:04 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 261
Registered: November 2012
Location: UK
Senior Member
Hi Ivan,
No, sorry, this is our own code calling getSystemClassLoader() and casting to URLClassLoader, not RAP.
I wonder if this is no longer supported in Java9+ or if there is a 'new' way of doing it? I haven't investigated too far yet, as I just assumed that versions of Java would be backwards-compatible, but if you have any other experiences, that would be useful?
Thanks, John


---
Just because you can doesn't mean you should
Re: RAP 3.7 and Java 11 Support [message #1802109 is a reply to message #1801745] Fri, 01 February 2019 09:41 Go to previous messageGo to next message
Linuxhippy Mising name is currently offline Linuxhippy Mising nameFriend
Messages: 36
Registered: July 2009
Member
John Gymer wrote on Fri, 25 January 2019 10:04
Hi Ivan,
No, sorry, this is our own code calling getSystemClassLoader() and casting to URLClassLoader, not RAP.
I wonder if this is no longer supported in Java9+ or if there is a 'new' way of doing it? I haven't investigated too far yet, as I just assumed that versions of Java would be backwards-compatible, but if you have any other experiences, that would be useful?
Thanks, John


For Java9' module system the class loader structure and architecture has been re-designed. Casting the system class loader to URLClassLoader was using an undocumented implementation detail, so breakage was to be expected.
Re: RAP 3.7 and Java 11 Support [message #1802260 is a reply to message #1802109] Tue, 05 February 2019 13:56 Go to previous messageGo to next message
John Gymer is currently offline John GymerFriend
Messages: 261
Registered: November 2012
Location: UK
Senior Member
Thanks Ivan.
I've re-written our Class Loader logic completely, as there is no direct work-around, so all is good now thanks, one of the keys being to use "Class.forName()" instead.
Cheers, John


---
Just because you can doesn't mean you should
Re: RAP 3.7 and Java 11 Support [message #1808401 is a reply to message #1801734] Mon, 24 June 2019 04:54 Go to previous message
Josh Mo is currently offline Josh MoFriend
Messages: 2
Registered: June 2019
Junior Member
Hi,

I am using the old version of RAP (version 1.3). Is the new version (version 3.9) compatible for the old version, so that I don't need to make any changes to my code?

Regards
Josh
Previous Topic:SIze of screen
Next Topic:RAP compatible for the older version
Goto Forum:
  


Current Time: Sat Dec 14 11:21:48 GMT 2019

Powered by FUDForum. Page generated in 0.03096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top