Overriding JVM packages declared in org.osgi.framework.system.packages [message #1790404] |
Sat, 09 June 2018 14:58 |
Andrew Johnson Messages: 205 Registered: July 2009 |
Senior Member |
|
|
We have a problem with Eclipse Memory Analyzer, Photon, OpenJ9 Java 10 and IBM DTFJ.
The packages com.ibm.dtfj.image, com.ibm.dtfj.java, com.ibm.dtfj.runtime are defined by both the OpenJ9 Java 10 JVM, and by a separate feature / plugins from IBM.
I want the Memory Analyzer DTFJ plugin to always use the separate DTFJ feature so it will work with any JVM.
With Photon and OpenJ9 Java 10 it seems every JDK package is put into org.osgi.framework.system.packages
so it starts like:
org.osgi.framework.system.packages=com.ibm.cuda, com.ibm.dataaccess, com.ibm.dtfj.image, com.ibm.dtfj.java, com.ibm.dtfj.runtime,
See Bug 527353
I then end up with the situation where com.ibm.dtfj.image.ImageFactory in the o.e.mat.dtfj plugin is loaded by jdk.internal.loader.ClassLoaders$AppClassLoader but the implementation in the plugin from com.ibm.dtfj feature is loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader
and the classes are not compatible.
See Bug 535351: Failure opening an IBM/OpenJ9 core dump with DTFJ under OpenJ9 Java 10
How should all this work?
It seems a bit odd for Equinox to export all of the JVM classes in such a way that they override real plugins. Ideally I would like a solution which does not involve changing startup options as MAT might be installed in an existing Eclipse.
On the other hand, in another plugin I do want to get access to com.sun.tool.attach package from the JVM via reflection if it is available, so totally hiding extra JVM packages in Java 10 is also not suitable - unless there was a way to ask for them which also worked with Java 8.
Any comments or ideas?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03054 seconds