JNLPClassLoader cannot find class: ClassNotFoundException

Get help with installation and configuration of OWS. Please post specific bug reports, pull requests, or source code extensions on github.
marek
Posts: 3
Joined: 22 Jun 2022, 19:18

JNLPClassLoader cannot find class: ClassNotFoundException

Post by marek »

We experience some strange behavior when running a graphical application using, which is started using OpenWebStart 1.6.0 running on Oracle Java 17.0.1 on Windows 10. The application is correctly downloaded to the client from the server as defined in the JNLP and after the start the following two ClassNotFoundExceptions the being thrown:

Code: Select all

java.lang.NoClassDefFoundError: javax/media/jai/JAI
                at com.luciad.format.raster.TLcdGeoTIFFModelDecoder.<clinit>(LuciadLightspeed_2020.1.19:328)
                at com.luciad.lucy.addons.decoders.aD.a(LuciadLightspeed_2020.1.19:42)
                at com.luciad.internal.lucy.format.TLcyLazyModelDecoderWrapperFactory$TLcyLazyModelDecoder.a(LuciadLightspeed_2020.1.19:109)
                at com.luciad.internal.lucy.format.TLcyLazyModelDecoderWrapperFactory$TLcyLazyModelDecoder.b(LuciadLightspeed_2020.1.19:101)
                at java.base/java.lang.Iterable.forEach(Iterable.java:75)
                at com.luciad.internal.lucy.format.c.run(LuciadLightspeed_2020.1.19:193)
                at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: javax.media.jai.JAI
                at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.lambda$loadClass$9(JNLPClassLoader.java:1446)
                at java.base/java.util.Optional.orElseThrow(Optional.java:403)
                at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.loadClass(JNLPClassLoader.java:1446)
                at com.luciad.format.raster.TLcdGeoTIFFModelDecoder.<clinit>(LuciadLightspeed_2020.1.19:328)
                at com.luciad.lucy.addons.decoders.aD.a(LuciadLightspeed_2020.1.19:42)
                at com.luciad.internal.lucy.format.TLcyLazyModelDecoderWrapperFactory$TLcyLazyModelDecoder.a(LuciadLightspeed_2020.1.19:109)
                at com.luciad.internal.lucy.format.TLcyLazyModelDecoderWrapperFactory$TLcyLazyModelDecoder.b(LuciadLightspeed_2020.1.19:101)
                at java.base/java.lang.Iterable.forEach(Iterable.java:75)
                at com.luciad.internal.lucy.format.c.run(LuciadLightspeed_2020.1.19:193)
                at java.base/java.lang.Thread.run(Thread.java:833)
 

Code: Select all

java.lang.NoClassDefFoundError: com/sun/media/imageioimpl/plugins/tiff/TIFFImageMetadata
                at com.luciad.lucy.addons.decoders.aD.a(LuciadLightspeed_2020.1.19:86)
                at com.luciad.internal.lucy.format.TLcyLazyModelEncoderWrapperFactory$TLcyLazyModelEncoder.b(LuciadLightspeed_2020.1.19:102)
                at com.luciad.internal.lucy.format.TLcyLazyModelEncoderWrapperFactory$TLcyLazyModelEncoder.a(LuciadLightspeed_2020.1.19:94)
                at java.base/java.lang.Iterable.forEach(Iterable.java:75)
                at com.luciad.internal.lucy.format.f.run(LuciadLightspeed_2020.1.19:186)
                at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata
                at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.lambda$loadClass$9(JNLPClassLoader.java:1446)
                at java.base/java.util.Optional.orElseThrow(Optional.java:403)
                at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.loadClass(JNLPClassLoader.java:1446)
                at com.luciad.lucy.addons.decoders.aD.a(LuciadLightspeed_2020.1.19:86)
                at com.luciad.internal.lucy.format.TLcyLazyModelEncoderWrapperFactory$TLcyLazyModelEncoder.b(LuciadLightspeed_2020.1.19:102)
                at com.luciad.internal.lucy.format.TLcyLazyModelEncoderWrapperFactory$TLcyLazyModelEncoder.a(LuciadLightspeed_2020.1.19:94)
                at java.base/java.lang.Iterable.forEach(Iterable.java:75)
                at com.luciad.internal.lucy.format.f.run(LuciadLightspeed_2020.1.19:186)
                at java.base/java.lang.Thread.run(Thread.java:833)

We can see in the log (attached) that the corresponding libs containing the classes are correctly loaded and available:
1. jai_core-1.1.4+8-lcd.jar
2. jai_imageio-1.2+23-lcd.jar

Is there anything special about the JNLPClassLoader which could prohibit to load them?
Or any other idea on the root cause of this issue? Is there any workaround like a different classloader to fix this issue? It's of course no problem to start the application as standalone without OpenWebStart.
Attachments
2022-06-22_17_49_29.16-ows-stage2.log
(1.07 MiB) Downloaded 13 times
2022-06-22_17_49_29.16-ows-stage1.log
(37.19 KiB) Downloaded 11 times

Janak Mulani
Posts: 450
Joined: 24 Mar 2020, 13:37

Re: JNLPClassLoader cannot find class: ClassNotFoundException

Post by Janak Mulani »

Code: Select all

java.lang.ClassNotFoundException: javax.media.jai.JAI
com.sun.media.imageioimpl.plugins.tiff.TIFFImageMetadata
Does your app run with Java 17 in standalone mode?

Please check if these classes are supported by Java 17? You will have to export modules or find alternative libs.

marek
Posts: 3
Joined: 22 Jun 2022, 19:18

Re: JNLPClassLoader cannot find class: ClassNotFoundException

Post by marek »

Yes, as standalone application in Oracle Java 17.0.1 it works just fine, the problem occur only when starting with OpenWebStart, tried version 1.5.2 and 1.6.0. Both these libraries are provided in the web-application and you can see in the log that these libraries are also correctly loaded from classpath.

Janak Mulani
Posts: 450
Joined: 24 Mar 2020, 13:37

Re: JNLPClassLoader cannot find class: ClassNotFoundException

Post by Janak Mulani »

Can you provide us with a sample to reproduce the issue?

Can you try running with https://github.com/karakun/OpenWebStar ... 0.0-alpha2 and let us know if it worked?

marek
Posts: 3
Joined: 22 Jun 2022, 19:18

Re: JNLPClassLoader cannot find class: ClassNotFoundException

Post by marek »

It works with the version 3.0.0-alpha2, but only when the console is visible, otherwise it is failing, screenshot attached.
Attachments
135C1F9F.PNG
135C1F9F.PNG (129.91 KiB) Viewed 165 times

Janak Mulani
Posts: 450
Joined: 24 Mar 2020, 13:37

Re: JNLPClassLoader cannot find class: ClassNotFoundException

Post by Janak Mulani »

Can you please send the logs of the time it runs and fails with OWS 3.0.0?

Will it be possible for you to provide a small example or allow us to run your Jnlp from our machine?

Post Reply