• Post Reply Bookmark Topic Watch Topic
  • New Topic

icedtea-web's JNLPClassLoader not finding local resource files

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.

my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!