简体   繁体   English

无法启动基于Java Web Start JNLP的应用程序(单签名JAR)

[英]Cannot start Java Web Start JNLP based application (single signed JAR)

I am using JNLP (Java Network Launch Protocol) for the first time, and cannot find a way to discover the source of a problem. 我是第一次使用JNLP(Java网络启动协议) ,但是找不到找到问题根源的方法。

My application is SWING based, and runs correctly as a stand alone JAR - Java Archive file. 我的应用程序基于SWING ,并且可以作为独立的JAR-Java Archive文件正确运行。 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. 我的内部应用程序记录器工具演示了该应用程序未到达Java Main方法的第一行。

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. 我的计算机Log和Trace在下面产生了相同的错误,但是我发现的大多数问题都与keytool / jarsigner阶段中的编码和语言有关。

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 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: 我的JNLP文件:

<?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) 在WAMP服务器上运行,MIME可以按预期工作,并且Mozzila Firefox提示用户启动Java Web Start(javaws)

Edit: 17/08/2017 编辑: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) 据我所知,该解决方案是仅使用基础知识来创建简化的JNLP文件,并仅在其中完全使用ANSI字符(例如名称组织,甚至是Alias / Password)来创建新的KeyStore。

Looks like you have a missing translation ( número ) for portuguese. 好像您缺少葡萄牙语的翻译( número )。 Try setting: 尝试设置:

<resources locale=""

To the same locale on which standalone jar works fine. 在独立jar可以正常工作的相同语言环境中。

Why? 为什么? Since 1) (As it looks like) you are launching JNLP via command line. 由于1)(看起来像),您是通过命令行启动JNLP的。 And 2) Locale is a OS/shell sensitive setting. 2)语言环境是OS / shell敏感设置。 And 3) Your trace file indicates JVM is on portuguese language. 并且3)您的跟踪文件表明JVM使用的是葡萄牙语。 And 4) It is a known case of missing translations as in this bug . 并且4)这是已知的缺少翻译的情况, 如此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. 这就是为什么我会尝试通过JNLP设置语言环境的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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