This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Error while siging the jar using jar signer

 
Ranch Hand
Posts: 38
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 38
Eclipse IDE Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot . I realized the mistake which I did. It is working now.
 
I do some of my very best work in water. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic