Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

icedtea-web's JNLPClassLoader not finding local resource files  RSS feed

J McCarch
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!