简体   繁体   中英

Java WebStart - 3rd party jar - manifest

I'm trying to run a Java WebStart application using Netbeans IDE. I've signed the application using a valid Comodo certificate. When I run the jar, it brings up a popup with the jar & its certificate's details. However, it then shows another popup with an error. I saw a post here with the same issue at Java Web Start manifest issue which provides the following solution:

I solved it.

In jnlpcomponent1.jnlp i see that sqljdbc4.jar is already signed by microsoft.

When i was looking to its manifest.mf it hasn't the attribute Permissions: all-permissions. So i delete all manifest file from sqljdbc4.jar and put an empty one (delete MSFTSIG.SF and MSFTSIG.RSA also). Build application again now with my signature and with Permissions: all-permissions in manifest file and works like a charm.

In my application, the ' jnlpcomponent1.jnlp ' file contains four 3rd party jars that are already signed. My question is how do I unpack these jar's (to replace the Manifest with a blank one & delete the .SF and .DSA files) & re-pack it ?

Is there a way to manually do it (eg, at command prompt ) ? Can I manually unpack these 4 jars, edit their Manifest , remove the .SF & .DSA files and re-pack them ? Please let me know. Thanks.

Update: I have managed to resolve the issue today. Thanks.

I know this isn't exactly how you would do it in netbeans, however if you were using a build system (such as gradle) to manage everything for the webstart, then you could add the line to your jar task in your build.gradle that looks like:

jar{
    from {configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }

    manifest{
        attributes("Main-Class": mainClassName);
    }
}

that takes every dependency (the third party jars) unpacks (unzips) them and then packs (zips) them back up into a single jar next to your own, along with all of their manifest/etc files. There is a gradle plugin for netbeans (we use at work with great success), but it would obviously take some work to convert your project over, just something to keep in mind. I hope that helps in any small way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM