4

I'm trying to use Java Web Start to replace a Java applet, but every time I run the .jnlp file either directly from the web server or directly from my computer it gives me an error.

I see the Java Web Start splash screen, and then the default progress bar appears. It downloads, and then verifies my jar, but shortly afterwards the following error message appears "Unable to launch the application".

CouldNotLoadArgumentException[ Could not load file/URL specified: C:\Users\[username]\AppData\Local\Temp\tmp_cache9015150161909242571.tmp]
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: C:\Users\[username]\AppData\Local\Temp\tmp_cache9015150161909242571.tmp (The system cannot find the file specified)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

I see no files in the Temp folder that look anything like tmp_cache.

Here is my JNLP file:

<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+"
    codebase="http://localhost:2020/MyServer/applets"
    href="basicTest.jnlp">
    <information>
        <title>JWS Test</title>
        <vendor>My Company</vendor>
    </information>

    <resources>
        <j2se version="1.7+"
            href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="basicTest.jar" main="true" />
    </resources>

    <application-desc
        name="Test Name"
        main-class="main.Entry">
    </application-desc>
    <update check="background"/>
</jnlp>

Things I've tried:

  • Downloading the JNLP file and the JAR from my web server (Works as expected)
  • Using a brand new, bare-bones jar with nothing but a main method and a System.out.print() statement (Same result)
  • Changing the href inside the .jnlp file (Different error message, can't find .jar, as expected. My server logs show this correctly as a 404)
  • Changing the value of the main-class attribute (Same result, suggests that the JVM never starts)
  • Running other example apps from Sun (These work correctly, either when running through the browser or when running downloaded .jnlp files)
  • Clearing my java cache and temp files (Same results)

I did wonder if the jars not being fully signed would matter (my jar is currently self-signed while in development) but I would expect a different error in that case.

It seems as though the jar file is downloaded into one location, and verified, but then can't be found when the JVM tries to start it. Could there be a cache location conflict?

6
  • 1
    What version of javaws are you using? Have you tried with jnlp spec="7.0+" (and removing the codebase bit)? Have you tried to use <update check="always" policy="always"/> to see if it could be a caching issue? Commented Aug 31, 2016 at 10:41
  • I've now tried those suggestions, and I believe removing the "codebase" has helped a little. The app now runs from my hard drive if I add "file:/" to my exception list because the jar doesn't meet the "high" security requirements, probably because it isn't signed. But it still doesn't work when I download it from my site (because now the path to the jar and jnlp for the update check is incorrect). Thank you for the help so far. Commented Aug 31, 2016 at 11:07
  • There were some bugs in some java 1.7 and even java 1.8 versions that messed up with the cache - are you using java 1.8 latest version? Commented Aug 31, 2016 at 12:08
  • 1
    Yes, the java console that loads using a working jnlp (without the codebase attribute) shows version 8 update 102. Commented Aug 31, 2016 at 12:34
  • Here's the full output: Java Web Start 11.102.2.14 amd64 Using JRE version 1.8.0_102-b14 Java HotSpot(TM) 64-Bit Server VM Commented Aug 31, 2016 at 12:40

1 Answer 1

0

One of the reason can be JRE 7 onwards security is high .Signing jar is required.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.