簡體   English   中英

無法啟動基於Java Web Start JNLP的應用程序(單簽名JAR)

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

我是第一次使用JNLP(Java網絡啟動協議) ,但是找不到找到問題根源的方法。

我的應用程序基於SWING ,並且可以作為獨立的JAR-Java Archive文件正確運行。 但是,在部署階段,我遇到了一個未知的問題,即應用程序在第一階段啟動,但無法運行。

我的內部應用程序記錄器工具演示了該應用程序未到達Java Main方法的第一行。

我的計算機Log和Trace在下面產生了相同的錯誤,但是我發現的大多數問題都與keytool / jarsigner階段中的編碼和語言有關。

我嘗試了幾種替代語言,在不同的位置重新啟動了計算機,甚至嘗試在另一台計算機上生成密鑰庫,總是產生相同的錯誤:

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)

我的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>

在WAMP服務器上運行,MIME可以按預期工作,並且Mozzila Firefox提示用戶啟動Java Web Start(javaws)

編輯:17/08/2017

我已經進行了一些更改,並且能夠使它起作用,但是,我仍然希望了解問題的根源,因此我不會關閉/刪除該問題。

據我所知,該解決方案是僅使用基礎知識來創建簡化的JNLP文件,並僅在其中完全使用ANSI字符(例如名稱組織,甚至是Alias / Password)來創建新的KeyStore。

好像您缺少葡萄牙語的翻譯( número )。 嘗試設置:

<resources locale=""

在獨立jar可以正常工作的相同語言環境中。

為什么? 由於1)(看起來像),您是通過命令行啟動JNLP的。 2)語言環境是OS / shell敏感設置。 並且3)您的跟蹤文件表明JVM使用的是葡萄牙語。 並且4)這是已知的缺少翻譯的情況, 如此bug所示

也許丟失/錯誤的翻譯不是來自您的代碼,而是來自庫。 這就是為什么我會嘗試通過JNLP設置語言環境的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM