1
votes

I am using JNLP (Java Network Launch Protocol) for the first time, and cannot find a way to discover the source of a problem.

My application is SWING based, and runs correctly as a stand alone JAR - Java Archive file. However, in my deployment stage, I am having an unknown issue, where the application launches at the first Phase, but does not operate.

My internal application Logger tool demonstrates that the Application does not reach the first line in my Java Main method.

My computer Log and Trace yield the same error below, however most issues I could find are related to encode and language in the keytool/jarsigner stage.

I have tried several alternative languages, rebooted the computer with a different location, and even tried to generate the keystore in a different machine, always yielding the same error:

javaws.trace

Log started: Fri, 11 Aug 2017 12:03:49 -0300
Java Web Start 11.141.2.15
Usando a versão do JRE
 1.8.0_141-b15 Java HotSpot(TM) 64-Bit Server VM
#### Java Web Start Error:
java.lang.IllegalArgumentException: unknown format type: número
    at java.text.MessageFormat.makeFormat(Unknown Source)
    at java.text.MessageFormat.applyPattern(Unknown Source)
    at java.text.MessageFormat.<init>(Unknown Source)
    at java.text.MessageFormat.format(Unknown Source)
    at com.sun.deploy.resources.ResourceManager.applyPattern(Unknown Source)
    at com.sun.deploy.resources.ResourceManager.getString(Unknown Source)
    at com.sun.javaws.exceptions.JNLParseException.getRealMessage(Unknown Source)
    at com.sun.javaws.exceptions.JNLPException.getMessage(Unknown Source)
    at com.sun.javaws.ui.LaunchErrorDialog.getMessage(Unknown Source)
    at com.sun.javaws.ui.LaunchErrorDialog.show(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)

My JNLP file:

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="http://www.myFakeSite.com/" href="myJNLP.jnlp">
    <information>
        <title>TITLE</title>
        <vendor>VENDOR</vendor>
        <homepage href ="http://www.myFakeSite.com"/>
        <description>MY APPLICATION</description>
        <description kind="short">My Application Description</description>
        <icon href="./imgs/splash.png"/>
        <icon kind="splash" href="./imgs/splash.png"/>
        <icon kind="shortcut" href="./imgs/icons.ico"/>
        <offline-allowed/>
        <shortcut online="false" install="true">
            <desktop/>
            <menu submenu="MENU">
                <menu submenu="SUB_MENU"/>
            </menu>
        </menu>
    </shortcut>
    </information>
    <update check="background" policy="prompt-update"/>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.8+" href="http://java.sun.com/products/autodl/j2se"/>
        <jar href="MYJAR.jar" main="true"/>
    </resources>
    <application-desc
        main-class="Main">
</jnlp>

Running on WAMP server, the MIME is working as expected, and the Mozzila Firefox prompts the user to start the Java Web Start (javaws)

Edit: 17/08/2017

I have performed several changes, and was able to make it work, however, I still desire to understand the source of the issue, so I wont close/delete this question.

As far as I can tell, the solution was creating a simplified JNLP file, with just the basics, and creating a new KeyStore, using only ANSI characters in it entirely (such as Name Organization, and even the Alias/Password)

1
Enable JRE´s Console Output and post it. - Sal
@Sal your comment confuses me. I already added the JRE output to the question. The fact that I have Unknown Source is the whole point where I cannot find where to search next. - Bonatti
Sorry the confusion. Since 1) We have many options to get trace/log files in java. And 2) Since last time I checked you cannot pop up the console from JNLP. 3) I pressume that you used the -verbose option of javaws via command line. 4) I cannot assume that a log file contains the whole console output. - Sal
@Sal Yes, I also have problems understanding how to "debug" a javaws application, when it wont launch. I have searched my application, for initialization failures, but have not been able to find any problem. I have changed the JAR (with another dummy one, with a single JOptionPane.showDIalog()) command, that also will not execute, with the same error. I have also changed the certification, yeilding the same result. I do think its a JVM or javaws issue, and cant find a direction to search next. My google-fu wont show significant threads too :( - Bonatti

1 Answers

-1
votes

Looks like you have a missing translation (número) for portuguese. Try setting:

<resources locale=""

To the same locale on which standalone jar works fine.

Why? Since 1) (As it looks like) you are launching JNLP via command line. And 2) Locale is a OS/shell sensitive setting. And 3) Your trace file indicates JVM is on portuguese language. And 4) It is a known case of missing translations as in this bug.

Perhaps the missing/wrong translation is not from your code but from a library. So that is why I would try setting the locale via JNLP.