1

I've been working on an applet-replacement application that has to run under Java 1.8, so I've signed all the JARs using a trusted certificate and added the attribute Trusted-Library: true to all their MANIFEST.MF files.

My JNLP looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="http://localhost:8080/myWebApp/myApp/
"href="myAppLaunch.jnlp" spec="1.0+">
    <information>
        <title>My JWS Application</title>
        <vendor>My Company</vendor>
        <homepage href=""/>
        <description>This application is an applet replacement that needs to satisfy the requirements of a High Security setting in a Java 1.8 environment</description>
        <description kind="short">My App</description>
    </information>
    <update check="always"/>
    <security>
<all-permissions/>
</security>
    <resources>
        <j2se version="1.7+"/>
        <jar href="myApp.jar" main="true"/>
    <jar href="lib/commons-httpclient-3.0.1.jar"/>
<jar href="lib/commons-logging-1.1.jar"/>
<jar href="lib/commons-codec-1.3.jar"/>
<jar href="lib/dmapiclientlib-1.3.03.jar"/>
<jar href="lib/mail.jar"/>
<jar href="lib/activation.jar"/>
<jar href="lib/log4j-1.2.17.jar"/>
<jar href="lib/datedFileAppender-1.0.2.jar"/>
</resources>
    <application-desc main-class="com.myCompany.myApp.myMainClass">
    <argument>action=myAction</argument>
</application-desc>
</jnlp>

When I launch the application via Java Web Start, I get a ClassNotFoundException for a class (URIException) in one of the JARs this application is dependent upon (commons-httpclient-3.0.1.jar).

I've been building this application via NetBeans and had done so successfully once before, but now for some reason, I can't get past this error. What am I doing wrong?

Sheldon R.
  • 452
  • 2
  • 7
  • 26
  • 1
    1) Be sure to check the JNLP using JaNeLA, available at my [share drive](https://drive.google.com/drive/#folders/0B5B9wDXIGw9lUnJaUjA2cmlVRE0). 2) Once that checks out with no errors (ignore the warnings and optimisations) uninstall it and try the app. again. If it still throws the error, post a) the content of the JNLP. b) the structure of the server showing the location if the JNLP and Jars. – Andrew Thompson Nov 04 '16 at 13:30
  • Thanks for your response, Andrew. I downloaded the janela.jar from your Google Drive but I'm unclear how to use it. Do I just run it, i.e. "java janela.jar" and a GUI appears, or do I have to include the name of the JNLP file in the command? – Sheldon R. Nov 04 '16 at 15:40
  • *"Do I just run it"* It has a GUI and is an executable Jar, just double click it! Hopefully the rest should become clear from the controls and labels. – Andrew Thompson Nov 04 '16 at 15:42
  • Actually, double-clicking the JAR only brought up the WinRAR archive tool on my system, but I got it going by running it on the command line. I don't know that it turned any meaningful errors, though, as this JNLP worked prior to my signing my JARs with a trusted certificate. I get the impression that the dependent JARs are not being loaded, despite their being signed with the same certificate and also designated as trusted library. Any idea what could be causing that? – Sheldon R. Nov 04 '16 at 15:59
  • *"Any idea what could be causing that?"* I might if you follow the 2nd suggestion in my first comment.. – Andrew Thompson Nov 04 '16 at 19:00
  • Be nice, Andrew :) The JWS application myApp is located in a folder called myApp that's a subfolder within a web application called myWebApp. So the location of the application JAR file would be in the directory [Tomcat Home]\webapps\myWebApp\myApp, and all of the JARs it depends on are in a subfolder called lib. I'll edit the question to include the JNLP – Sheldon R. Nov 07 '16 at 14:27
  • After some experimenting, I think I know what the problem is. In my attempt to get all these JARs to load as trusted libraries, I've been editing the MANIFEST.MF files after having the JARs signed, and that just "nullifies" the signatures, doesn't it? – Sheldon R. Nov 07 '16 at 15:13
  • *"Be nice, Andrew :)"* Be smart, Sheldon. ;) – Andrew Thompson Nov 07 '16 at 20:27
  • Does answering my own question count? :) – Sheldon R. Nov 08 '16 at 19:45

1 Answers1

1

I believe that the issue I've been running into stemmed from altering the JAR files (by adding a trusted-library attribute) after the JARs had been signed

Sheldon R.
  • 452
  • 2
  • 7
  • 26