Hello,
I'm working with JWS and jre 1.4.2 and I need to use an "installer" to copy special files.
So, I tried to create an application JNLP using this JSP:
<%@ page contentType="application/x-java-jnlp-file" autoFlush="true"%>
<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0'
codebase='http://localhost:9080/deployerWeb'
href='application.jsp'>
<information>
<title>Application</title>
<vendor>Company</vendor>
<description kind='one-line'>
Application
</description>
</information>
<resources>
<j2se version='1.4+' />
<extension href='http://10.142.87.92:9080/deployerWeb/installer.jsp' />
<jar href='application.jar' main='true' />
</resources>
<application-desc main-class='com.company.jws.Application' />
</jnlp>
and an installer using this one:
<%@ page contentType="application/x-java-jnlp-file" autoFlush="true"%>
<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0'
codebase='http://localhost:9080/deployerWeb'
href='installer.jsp'>
<information>
<title>Installer</title>
<vendor>Company</vendor>
<description kind='one-line'>
Installer
</description>
</information>
<resources>
<j2se version='1.4+' />
<jar href='installer.jar' main='true' />
</resources>
<installer-desc main-class='com.company.jws.Installer' />
</jnlp>
The installer does nothing:
package com.company.jws;
import javax.jnlp.ExtensionInstallerService;
import javax.jnlp.ServiceManager;
import javax.jnlp.UnavailableServiceException;
public class Installer {
protected static void install() {
try {
ExtensionInstallerService installerService = (ExtensionInstallerService) ServiceManager
.lookup("javax.jnlp.ExtensionInstallerService");
boolean installed = false;
try {
//JOptionPane.showMessageDialog(null, "TODO: write common files");
installed = true;
} finally {
if (installed) {
installerService.installSucceeded(false);
} else {
installerService.installFailed();
}
}
} catch (UnavailableServiceException e) {
//JOptionPane.showMessageDialog(null, "Install failed!");
}
}
protected static void uninstall() {
//JOptionPane.showMessageDialog(null, "TODO: delete common files");
}
public static void main(String[] args) throws UnavailableServiceException {
if (args[0].equals("install")) {
install();
} else {
uninstall();
}
}
}
When I launch the application JNLP, everything is downloaded correctly, but when JWS start the installer, the progress bar is blicking.
When I finally decide to cancel the installer, I have the following error:
JNLPException[category: Erreur dans le fichier de lancement ("Error in the launching file"): Exception: null : LaunchDesc:
<jnlp spec="1.0" codebase="http://10.142.87.92:9080/deployerWeb/" href="http://10.142.87.92:9080/deployerWeb/installer.jsp">
<information>
<title>Installer</title>
<vendor>Company</vendor>
<homepage href="null"/>
<description></description>
<description kind="short"></description>
<description kind="one-line">
Installer
</description>
<description kind="tooltip"></description>
</information>
<resources>
<j2se initial-heap-size="-1" max-heap-size="-1" version="1.4+"/>
<jar href="http://localhost:9080/deployerWeb/installer.jar" download="eager" main="true"/>
</resources>
<installer-desc main-class="com.michelin.jws.Installer"/>
</jnlp> ]
at com.sun.javaws.Launcher.executeInstallers(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I spend the entire day to search solution over internet, but I didn't find anything relevant.
The same code and JNLPs are working fine with java 1.6...
Can someone help me please !!!