Forums Register Login

icedtea-web's JNLPClassLoader not finding local resource files

+Pie Number of slices to send: Send
In running a javaws application with icedteaweb and openjfx/openjdk, the .css stylesheets in jfxrt.jar are not loading, causing the windows to be displayed incorrectly. I tracked down the problem to JNLPClassLoader being created without a parent, causing only the resource files in the .jnlp file to be found and not those in the local jre/lib/ext/*.jar. This is due in turn to the JNLPClassLoader's constructor, which calls super(new URL[], JNLPClassLoader.class.getClassLoader()). But JNLPClassLoader.class.getClassLoader is ALWAYS returning null, causing JNLPClassloader to be created with null parent, as per above.

In the document for Class, it appears that in some implementations if the loader for a class is the bootloader, getClassLoader will return null; I assume this may be the problem here. I don't see how this problem has not been noticed before but I can't find anything online about it.

I would like to know if anyone else who is using icedtea-web is seeing this problem, or conversely is able to use it and still access local jar files.

BTW if I change the constructor to use ClassLoader.getSystemClassLoader() instead of JNLPClassLoader.class.getClassLoader() in the above call to super() and recompile, everything seems to work fine.

bacon. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1771 times.
Similar Threads
Fatal: Read Error: Could not read or parse the JNLP file.
SystemClassLoader
WebStart auto-update doesn't always work properly
Error with Java WebStart Signed Jars on 1.7.0_40
Signing JNLP - Where does JNLP-INF directory go?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:09:02.