JNLP installer does not start
843802Dec 9 2005 — edited May 30 2006Hello all,
I have recently created JNLP installer descriptor to install COM libraries. But before we get there, I must say that the installer had no chance being started at all. After Java Web Start downloaded all resources (NOT including the installer JARs) it has shown the message: "Starting installer...". Then it remains visible for 2-3 seconds and then disappears. The "javaw.exe" process remains. Note: it is not "javaws.exe". I guess (not quite sure) the problem is somewhere between starting separate "javaw.exe" to serve the installer, and entry point of the installer itself. I have guessed that I must enable JWS logging and to check its log in order to understand what is happening. Here is the log:
*********************************************************************************
Java Web Start 1.4.2_10 Console, started Thu Dec 08 15:53:54 EET 2005
Java 2 Runtime Environment: Version 1.4.2_10 by Sun Microsystems Inc.
Logging to file: C:\Documents and Settings\Rees\My Documents\javaws.log
java.lang.NullPointerException
at com.sun.javaws.LaunchSelection.selectJRE(Unknown Source)
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)
Here is the <installer-desc> JNLP:
*********************************************************************************
<?xml version="1.0" encoding="windows-1251"?>
<jnlp spec="1.0+" codebase="http://realhost.com" href="/project/native.jnlp">
<information>
<title>Project 1.0 BETA1</title>
<vendor>Company Ltd.</vendor>
<offline-allowed/>
</information>
<security><all-permissions/></security>
<resources os="windows" arch="x86">
<jar href="/project/installer.jar" main="true"/>
<nativelib href="/project/native.jar"/>
</resources>
<installer-desc main-class="somecompany.installer.InstallSomeLibs"/>
</jnlp>
That's it. I see nothing wrong there. Everything complies with JNLP 1.0.1 spec.
Two JARs contain the installer class files (including "javax.jnlp" package -- is it wrong to include it inside? Maybe in the context of JWS "javax.jnlp.*" classes are visible?) and native libraries.
But there is one thing -- when I looked in the JWS cache, I did not saw (100% sure) the two JARs which contain installer classes and native libraries. That's strange -- I think they should be downloaded before issuing message "Starting installer...", right? But since I am not an expert of how Java Web Start is implemented, I cannot claim that.
My installer class instantiates "javax.jnlp.ExtensionInstallerService" via "javax.jnlp.ServiceManager.lookup(...)" and then updates progress, changes status line etc., calls "setNativeLibraryInfo" and finally calls "installSucceeded(boolean)" or "installFailed". Again, everything should be as specified in the docs.
In manifest file of "installer.jar" (where the actual installer resides) I have put "Vendor:" and "Main-Class:" attributes. Something wrong?
Also, I have ensured logging immediately after the installer class starts -- i.e. it creates log-file and logs every action I decided to expose in the log. It should create the log like that:
*********************************************************************************
PrintStream log = new PrintStream(new FileOutputStream(new File(System.getProperty("user.home") + File.separator + "SomeCompany" + File.separator + "jnlp-installer.log")));
Immediately after that the installer starts to do logging. But the file (nor the directory, which the installer will create if the directory did not existed) actually does not even get created. This is an indication to me that the installer never gets called (and as pointed above -- not downloaded, too). It gets worse -- after the last test I discovered that even the static initializer is not called! Well, that's logical, since the JARs are never downloaded. And the error indication I possess is just this tiny stack trace.
And finally, I created a dummy installer. All it does is to instantiate "ExtensionInstallerService" and to inform it that "installation" has succeeded. Nothing! Same error over and over again.
And absolutely finally, when I installed JRE 1.5.0_05, Java Web Start has shown that my installers are 0.0 KB. How and why?
Please, somebody help. Or just remind me to check something that I might overlooked.
Regards.
-
Dimitar Panayotov
C, C++, Java programmer/developer
Web developer - [X]HTML, XML+XSLT, CSS, JavaScript, PHP
develop@mail.bg
+359886455387