Search code examples
javajava-web-startclassnotfoundexceptiontrusted

ClassNotFoundException Thrown in Java Web Start Trusted-Library Application


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?


Solution

  • 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