I have a problem with my Java Web Start application. I have an JavaEE Application running in a Wildfly 9 container. I pass a property-file to the Web Start application which contains an URL to a csv file and an url to an template file.
When I run the application for the 1st time the application downloads the property file, loads the URL from the property file entries and downloads the csv file and the templatefile and does a mail merge with the files.
When I run the Web Start application a second, third, ... time its allways downloading the property file from the 1st run. Even the property file is overwritten everytime the user starts the Web Start application.
I've found out that when I deploy my application to Wildfly via "Full publish" from eclipse the Web Start application is working fine but when I deploy my application via "Project --> Export --> WAR file" and place the .war file at the deployment folder in my Wildfly installation I do get the behaviour explained above.
Some additional infos: Deployment via "Export WAR file" console output, 1st run:
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
2nd run:
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
And this is the JNLP-file
<?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>
I need to get it working with deployment via "Export WAR file". Anybody know what's the problem?
------------------------------EDIT-------------------------------------
This is the load process of the property file, here is everything fine, I can manually open the property file and the content is correct.
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();
}
Thats how I download the property file
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) is a method from the appache FileUtils. The downloaded property file has invalid content. It is everytime the content from the 1st run.
Sincerly Arthur