aspose file tools*
The moose likes Applets and the fly likes Error while siging the jar using jar signer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Error while siging the jar using jar signer " Watch "Error while siging the jar using jar signer " New topic
Author

Error while siging the jar using jar signer

Anil Kumar
Ranch Hand

Joined: Nov 16, 2008
Posts: 38

Dear All,

I have unsigned applet. For signing it I have created a keystore using the following command


Then I sign it using the following command



When I sign the jar (sign.jar ) using JAR Signer Command, I am getting exception message “Could not read LOC header ". The detail stack trace is attached for reference.

Exception in thread "main" java.lang.InternalError: jzentry == 0,
jzfile = 46472800,
total = 4,
name = Sign.jar,
i = 1,
message = couldn't read LOC header
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:429)
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:415)
at sun.security.tools.JarSigner.getManifestFile(JarSigner.java:1449)
at sun.security.tools.JarSigner.signJar(JarSigner.java:836)
at sun.security.tools.JarSigner.run(JarSigner.java:194)
at sun.security.tools.JarSigner.main(JarSigner.java:75)


I have rebuild the jar file and repeated the process again but I am getting the same error. Please let me know where I am
going wrong ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42947
    
  70
You should specify a different file for the "-signedjar" option. As it is, the jar file is read and written to by the same process, which doesn't work.
Anil Kumar
Ranch Hand

Joined: Nov 16, 2008
Posts: 38

Thanks a lot . I realized the mistake which I did. It is working now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while siging the jar using jar signer