[graalvm-users] Support for URLStreamHanderFactory?

Thomas Watson tjwats at gmail.com
Thu Oct 10 06:11:16 PDT 2019


Hi

I've been investigating possibilities for enhancing Eclipse Equinox
Framework to allow it to run across different "class path" models.  This
includes running out of a flat class path or using the JPMS in Java 9+
module path to load OSGi bundles and components into the Framework which
are not controlled by the OSGi module layer class loaders.  One interesting
aspect of this could be to try compiling a set of OSGi bundles and the
Equinox Framework into a Graal Substrate native image.

I have been making some progress, but have hit a surprising limitation that
I want to confirm and see if there is any workarounds or plans to remove
the limitation.  It appears native image applications cannot set the
URLStreamHandlerFactory.  I get this exception at runtime when I do:

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported
field java.net.URL.handlers is reachable
    at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:102)
    at java.net.URL.setURLStreamHandlerFactory(URL.java:1118)
    at
org.eclipse.osgi.internal.url.EquinoxFactoryManager.installURLStreamHandlerFactory(EquinoxFactoryManager.java:42)

I'm curious why such a limitation exists and if there is any way to work
around it?  I can catch this exception at runtime and move on, but it does
remove a important feature of the Framework.

Thanks

Tom Watson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/graalvm-users/attachments/20191010/fbb53b2b/attachment.html 


More information about the GraalVM-Users mailing list