简体   繁体   中英

IcedTea version 1.8 is unable to open any JNLP file

Currently I am unable to open a .jnlp file (TopCoder Arena) on Ubuntu 18.04. It gives an error message

net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. The application has not been initialized, for more information execute javaws/browser from the command line and send a bug report.
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:582)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:945)

Earlier it was working fine. But I guess, the recent updates are the issue for the problem. I have tried the solutions from these two sources https://forums.linuxmint.com/viewtopic.php?t=294555 and AskUbuntu . Till now I am unable to find a way to start the Arena. I have also tried solutions from this thread https://apps.topcoder.com/forums/?module=Thread&threadID=618387&start=0 but none of them is working. Solutions which I have tried till now:
1.Cleared the application Cache.
2.Downgraded from Java 11 to 8
I am unable to downgrade IcedTea to version 1.6 as version 1.6 is not working on my system.

Here is Error message:

net.sourceforge.jnlp.LaunchException: Fatal: Launch Error: Could not launch JNLP file. The application has not been initialized, for more information execute javaws/browser from the command line and send a bug report.
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:582)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:945)
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:576)
    ... 1 more
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
    at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:305)
    at java.xml/javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:261)
    at java.xml/javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:147)
    at com.topcoder.client.ui.impl.XMLUIManager.<init>(Unknown Source)
    at com.topcoder.client.ui.UIFactory.getUIManager(Unknown Source)
    at com.topcoder.client.ui.UIFactory.getUIManagerFromResource(Unknown Source)
    at com.topcoder.client.contestApplet.common.LocalPreferences.getAllUIManagers(Unknown Source)
    at com.topcoder.client.contestApplet.ContestApplet.<init>(Unknown Source)
    at com.topcoder.client.contestApplet.runner.generic.main(Unknown Source)
    ... 6 more
Caused by: java.lang.RuntimeException: Provider for class javax.xml.parsers.SAXParserFactory cannot be created
    at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:302)
    ... 14 more
Caused by: java.util.ServiceConfigurationError: javax.xml.parsers.SAXParserFactory: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
    at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:588)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1211)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1220)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator$1.run(ServiceLoader.java:1267)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator$1.run(ServiceLoader.java:1266)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1269)
    at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1299)
    at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1384)
    at java.xml/javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:287)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.xml/javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:283)
    ... 14 more

Apparently, IcedTea will not work with Java 11. There are three alternatives:

  1. Stop using JNLP, applets, JWS and so on. They are no longer supported by Oracle or OpenJDK. The Oracle recommended replacement for many use-cases is building and distributing executables created using jlink.

  2. Downgrade to OpenJDK 8. See @Sankalp1999's answer .

    This will only be viable until April 2021 when the Ubuntu packages for OpenJDK 8 will reach end-of-life and stop getting security updates. It is possible that you will be able to find a Java vendor who will back-port security patches, but it is (IMO) unlikely that you will be able to get them via the Canonical repositories.

  3. Switch to OpenWebstart .

I had been facing the same problem. I solved it by first deleting the existing versions(higher) of Java. Then, installing open-JDK 8. After that, I installed the required dependencies for iced-tea applet.

sudo apt purge oracle-java11-* -y
sudo apt purge *openjdk* -y
sudo apt autoremove --purge -y

After that, I followed this thread https://askubuntu.com/questions/1134881/icedtea-8-cannot-run-any-jnlp-application-maybe-due-to-openjdk-11

Some of the links are not working in that thread. So first, you need to install Open JDK 8.

sudo apt-get update
sudo apt-get install openjdk-8-jdk

Verify the version of the java you have installed.

java -version

If the correct version of Java is not being used, use the alternatives command to switch it

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_version/bin/java

Now, you can go back to the first thread that I have referenced. Run the links. If they are already installed, then it is not a problem.

After that, you can go to the directory of the applet and run

javaws ContestAppletProd.jnlp

References:

  1. https://askubuntu.com/questions/1134881/icedtea-8-cannot-run-any-jnlp-application-maybe-due-to-openjdk-11
  2. https://docs.datastax.com/en/jdk-install/doc/jdk-install/installOpenJdkDeb.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM