0

Java Web Start アプリケーションに問題があります。Wildfly 9 コンテナーで JavaEE アプリケーションを実行しています。csv ファイルへの URL とテンプレート ファイルへの URL を含むプロパティ ファイルを Web Start アプリケーションに渡します。

初めてアプリケーションを実行すると、アプリケーションはプロパティ ファイルをダウンロードし、プロパティ ファイルのエントリから URL をロードし、csv ファイルとテンプレート ファイルをダウンロードして、ファイルとの差し込み印刷を行います。

Web Start アプリケーションを 2 回目、3 回目、... 実行すると、常に最初の実行からプロパティ ファイルがダウンロードされます。プロパティ ファイルも、ユーザーが Web Start アプリケーションを起動するたびに上書きされます。

Eclipse から「フル パブリッシュ」を介してアプリケーションを Wildfly にデプロイすると、Web Start アプリケーションは正常に動作しますが、「プロジェクト --> エクスポート --> WAR ファイル」を介してアプリケーションをデプロイし、.私のWildflyインストールの展開フォルダーに.warファイルがあると、上記で説明した動作が得られます。

いくつかの追加情報: 「WAR ファイルのエクスポート」コンソール出力によるデプロイ、1 回目の実行:

Java Web Start 11.65.2.17
JRE-Version verwenden 1.8.0_65-b17 Java HotSpot(TM) Client VM
Benutzer-Home-Verzeichnis = C:\Users\arthurw
c:   Konsolenfenster löschen
f:   Objekte in Finalisierungs-Queue finalisieren
g:   Garbage Collect
h:   Diese Hilfemeldung anzeigen
m:   Speicherauslastung drucken
o:   Logging auslösen
p:   Proxykonfiguration neu laden
q:   Konsole ausblenden
r:   Policy-Konfiguration neu laden
s:   System- und Deployment-Eigenschaften ausgeben
t:   Threadliste ausgeben
v:   Threadstack ausgeben
0-5: Traceebene auf <n> setzen

CacheEntry[http://localhost:8080/browser/resources/webstart/715.jnlp]: updateAvailable=true,lastModified=Tue Nov 24 12:23:01 CET 2015,length=831
CacheEntry[http://localhost:8080/browser/resources/webstart/Textverwaltungsschnittstelle.jar]: updateAvailable=true,lastModified=Tue Nov 24 12:21:14 CET 2015,length=2728463
Missing Permissions manifest attribute in main jar: http://localhost:8080/browser/resources/webstart/Textverwaltungsschnittstelle.jar
CacheEntry[http://localhost:8080/browser/resources/webstart/715.properties]: updateAvailable=true,lastModified=Tue Nov 24 12:23:34 CET 2015,length=298
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 298
fileName = 715.properties
File downloaded
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 2823
fileName = 715_2015_11_24_12_26_16.csv
File downloaded
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 37405
fileName = 715_2015_11_24_12_26_16.DOCX
File downloaded
The Library been loaded, and an activeX component been created

2 回目の実行:

Java Web Start 11.65.2.17
JRE-Version verwenden 1.8.0_65-b17 Java HotSpot(TM) Client VM
Benutzer-Home-Verzeichnis = C:\Users\arthurw
----------------------------------------------------
c:   Konsolenfenster löschen
f:   Objekte in Finalisierungs-Queue finalisieren
g:   Garbage Collect
h:   Diese Hilfemeldung anzeigen
m:   Speicherauslastung drucken
o:   Logging auslösen
p:   Proxykonfiguration neu laden
q:   Konsole ausblenden
r:   Policy-Konfiguration neu laden
s:   System- und Deployment-Eigenschaften ausgeben
t:   Threadliste ausgeben
v:   Threadstack ausgeben
0-5: Traceebene auf <n> setzen
----------------------------------------------------
Missing Permissions manifest attribute in main jar: http://localhost:8080/browser/resources/webstart/Textverwaltungsschnittstelle.jar
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 298
fileName = 715.properties
File downloaded
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 2823
fileName = 715_2015_11_24_12_26_16.csv
File downloaded
Content-Type = application/octet-stream
Content-Disposition = null
Content-Length = 37405
fileName = 715_2015_11_24_12_26_16.DOCX
File downloaded
The Library been loaded, and an activeX component been created

そして、これはJNLPファイルです

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/browser/resources/webstart" href="715.jnlp">
     <information>
          <title>Textverwaltung Schnittstelle</title>
          <description>automatisierte Serienbriefbefüllung mithilfe Ihrer Textverwaltung</description>
     </information>
     <security>
          <all-permissions/>
     </security>
     <resources>
          <j2se version="1.6+" />
          <jar href="Textverwaltungsschnittstelle.jar" main="true"/>
     </resources>
     <update check="always" policy="always"/>
     <application-desc main-class="mm.Textverwaltungsschnittstelle">
        <argument>http://localhost:8080/browser/resources/webstart/715.properties</argument>
     </application-desc>
</jnlp>

「WARファイルのエクスポート」を介した展開で動作させる必要があります。何が問題なのか知っている人はいますか?

- - - - - - - - - - - - - - - 編集 - - - - - - - - - - ------------------

これはプロパティ ファイルのロード プロセスです。これで問題ありません。プロパティ ファイルを手動で開くことができ、内容は正しいです。

Properties clientprops=new Properties();
clientprops.put("modus", modus);
clientprops.put("templatepath", templateUrl);
clientprops.put("csvpath", csvUrl);
String propertypath=jnlpdir + user + ".properties";
File fp = new File(propertypath);
OutputStream out;
try {
  out = new FileOutputStream(fp);
  clientprops.store(out, "Benötigte Attribute für die Aktivierung der Textverwaltungsschnittstelle");
} catch (IOException e2) {
    e2.printStackTrace();
}

それがプロパティファイルをダウンロードする方法です

File proppath = new File(tmpdir + "prop.properties");
URL url;
try {
  url = new URL(args[0]);
  FileUtils.copyURLToFile(url, proppath);
} catch (IOException e) {
  showFehler("Properties konnten nicht kopiert werden");
}

copyURLToFile(url, proppath) は、apache FileUtils のメソッドです。ダウンロードしたプロパティ ファイルに無効なコンテンツが含まれています。初回から毎回の内容です。

敬具 アーサー

4

1 に答える 1

0

説明したように:

ed アプリケーション内でダウンロードしたプロパティ ファイルWebStartを更新し、公開された .war に含めて動作させる必要があります。したがって、これは WebStart または wildfly または JNLP に関連するものではなく、ビルド プロセス中に考慮する必要があります。

于 2015-11-24T14:14:47.387 に答える