File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JNLP and Web Start and the fly likes JNLP mutiple JAR launching issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "JNLP mutiple JAR launching issue" Watch "JNLP mutiple JAR launching issue" New topic
Author

JNLP mutiple JAR launching issue

Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
Hi,

I have a swing application which I can launch using JNLP.
Some screen refers to an external jar tablelayout.jar kept in a folder in ROOT Tomacat6.

The jnlp is as below.

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="Test.jnlp">
<information>
<title>HCS TESTING</title>
<vendor>SUHAS</vendor>
<homepage href="http://localhost:8080/" />
<description>Testing Testing</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<property name="jnlp.packEnabled" value="true"/>
<j2se version="1.6+ 1.5+ 1.4+ 1.3+"/>
<jar href="hcs.jar" main="true" download="eager"/>
<jar href="hcsLib/tableLayout.jar" />
</resources>

<application-desc main-class="com.test.admin.desktop.HCSMainFrm">
<argument>-f</argument>
<argument>Client.cfg</argument>
</application-desc>
</jnlp>

When I remove the

<jar href="hcsLib/tableLayout.jar" />

entry the application launches perfectly. But when I include it I am not able to launch the application and give the exception like

#### Java Web Start Error:
#### Found unsigned entry in resource: http://localhost:8080/hcsLib/tableLayout.jar

I need the jar as it supports the look and feel. Please help to resolve this.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

Welcome to the Ranch, Suhas!

Generally, every component of an application being run via WebStart must be signed. The problem seems to be that the file tableLayout.jar is not signed. You seem to be signing other files in your application (otherwise it would not run), so you probably might sign this file using the same certificate too. There is probably an Ant task for signing files, or you could do so manually using the jarsigner tool from the JDK.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

Martin Vajsar wrote:There is probably an Ant task for signing files, or you could do so manually using the jarsigner tool from the JDK.

Sure is


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
Thanks for the reply martin and maneesh....

The jar is downloaded from a third party site (So do we need to sign it again with the same certificate?).
I tried to sign the jar using same certificate.
Still it is showing the previous error message.

I have another query (Sorry not part of JNLP) ..

Could you please help to suggest sign all the jar in folder simultaneously with same certificate?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3610
    
  60

You should not need to sign the third-party library if it was signed, but the error message seems to indicate it isn't properly signed. You can run jarsigner -verify -verbose file.jar to display information about the problematic file.

I'd prefer to sign all components of a single application using a single certificate, but frankly this is just my guess, I don't know what the standards/common practices are when including a third party signed jar in your project.

jarsigner does not seem to offer an option to sign multiple files, but this can be easily done from the command line using OS shell support: in Windows, there is the for command, for example. (It's been ages since I was on Unix and I don't remember the corresponding shell command, but generally Unix shells are much more powerful than the cmd in Windows.)
Suhas Mohamedali
Greenhorn

Joined: Jun 05, 2012
Posts: 29
Thanks martin.

I need to sign every jar in the folder and it worked.
But i needed to do it for all jars separately . But the application is running now.

Jacob Anawalt
Ranch Hand

Joined: Oct 27, 2010
Posts: 32

I have had similar problems when including 3rd party jars in the jnlp resources. JWS wants all jars within a jnlp to be signed by the same certificate.

One way to use a signed 3rd party jar without removing their signature and re-signing is to make an additional component-desc JNLP file and point to it from your main JNLP as an extension.



Jacob
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JNLP mutiple JAR launching issue