App not starting with Java21 - JarIndex not found

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
mredeker
Posts: 6
Joined: 21 Jul 2023, 13:54

App not starting with Java21 - JarIndex not found

Post by mredeker »

All,

we are testing our application with Java21 and realized that it does not start with OpenWebstart 1.8 and Temurin 21.
Here is the error from the log:

Code: Select all

Closing DownloadServiceListener
Exiting Boot.mainWithReturnCode() with 0
    ... 13 more 
    at net.adoptopenjdk.icedteaweb.jdk89access.JarIndexAccess.<clinit>(JarIndexAccess.java:39) 
Caused by: java.lang.RuntimeException: JarIndex not found! 
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:660) 
    at net.sourceforge.jnlp.Launcher.access$300(Launcher.java:71) 
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:373) 
    at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:584) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.getInstance(JNLPClassLoader.java:468) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.getInstance(JNLPClassLoader.java:495) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.createInstance(JNLPClassLoader.java:423) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.<init>(JNLPClassLoader.java:350) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.initializeResources(JNLPClassLoader.java:827) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.activateJars(JNLPClassLoader.java:1177) 
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.lambda$activateJars$3(JNLPClassLoader.java:1176) 
    at net.sourceforge.jnlp.runtime.classloader.JNLPClassLoader.doActivateJars(JNLPClassLoader.java:1276) 
Caused by: java.lang.ExceptionInInitializerError 
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:681) 
Exception in thread "NEO Warenwirtschaftssystem" java.lang.RuntimeException: java.lang.ExceptionInInitializerError 
General Throwable encountered:
jdk.internal.util.jar.JarIndex not found
sun.misc.JarIndex not found - Running jdk9+ ?
DownloadServiceListener will be disposed
Could that have todo with this issue: https://www.mail-archive.com/debian-bug ... 33238.html

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

I will try to reproduce it and revert.

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

I could reproduce.

With Java 11,17,18,19,20: App runs even if sun.misc.JarIndex not found, jdk.internal.util.jar.JarIndex is found and used.

With Java 21 jdk.internal.util.jar.JarIndex is not found.

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

We have created an issue and will try to fix in the upcoming release.

Probable fix could be for OWS/ITW to ignore loading classes from Jar Indexes for JDK >= 21

https://bugs.openjdk.org/browse/JDK-8302819

"
https://www.oracle.com/java/technologie ... NewFeature

core-libs/java.util.jar
➜ Remove the JAR Index Feature (JDK-8302819)

The "JAR Index" feature has been dropped from the JAR file specification. JAR Index was a legacy optimization in early JDK releases to allow downloading of JAR files to be postponed when loading applets or other classes over the network. The feature has been disabled since JDK 18, meaning the META-INF/INDEX.LIST entry in a JAR file is ignored at run-time.

The system property jdk.net.URLClassPath.enableJarIndex, introduced in JDK 18 to re-enable the feature, has been removed. Setting this property no longer has any effect.

As part of the change, the jar tool will now output a warning if the -i or --generate-index options are used."

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

This has been fixed https://github.com/AdoptOpenJDK/IcedTea-Web/pull/925 and will be part of the next release.

mredeker
Posts: 6
Joined: 21 Jul 2023, 13:54

Re: App not starting with Java21 - JarIndex not found

Post by mredeker »

Thanks for looking into this.
No rush for us, so next release is fine.

bfolleas
Posts: 10
Joined: 16 Mar 2023, 18:35

Re: App not starting with Java21 - JarIndex not found

Post by bfolleas »

Hello,
when do you plan to release a version with this fix ?

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

Planned for this week unless there are some issues.

Stephan Classen
Posts: 232
Joined: 27 Mar 2020, 09:55

Re: App not starting with Java21 - JarIndex not found

Post by Stephan Classen »

new release 1.9.0 is now available

MoAlom
Posts: 1
Joined: 01 Feb 2023, 12:09

Re: App not starting with Java21 - JarIndex not found

Post by MoAlom »

Hi All, Does anyone know how to resolve the issue. This issue is affecting all our users within the organization. Is it possible to download the older version of the JVM instead of using version 21.

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

Re: App not starting with Java21 - JarIndex not found

Post by Janak Mulani »

Are you still getting "Caused by: java.lang.RuntimeException: JarIndex not found!". ? This is fixed in OWS 1.9.0.

Of course you can specify the Java version you want to use to start the application in your Jnlp file. What have you specified in your Jnlp file.

Also what does your JVM Manager setting look like in itw-settings?

bfolleas
Posts: 10
Joined: 16 Mar 2023, 18:35

Re: App not starting with Java21 - JarIndex not found

Post by bfolleas »

The issue is fixed for me with OpenJDK 21.0.1. In jnlp is specified 21+

Post Reply