Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  jarsigner and jar bizarreness  (Read 1682 times)
0 Members and 1 Guest are viewing this topic.
Offline Bombadil

Senior Member





« Posted 2004-02-27 13:10:18 »

I am using Java 1.4.2_02-b03 on Windows (2000) and experience the following very strange behaviour, when trying to jarsign some archives to be used for Webstart...

Suppose the classes are in a folder named "packagename".

Method A) Pack the JAR file with the following command:
1  
jar -cf App.jar packagename

1  
2  
3  
4  
jar -tf App.jar
packagename/Mainclass.class
packagename/subpackage/
packagename/subpackage/Another.class

Now jarsign it and and verify it. Results in this report:
1  
2  
jarsigner -verify App.jar
Note: This jar contains unsigned entries which are not integrity-checked. Re-run with -verbose to list unsigned entries.

1  
2  
3  
4  
jarsigner -verify App.jar
smk   1023 Wed Feb 25 22:30:18 CET 2004 packagename/Mainclass.class
         0 Wed Feb 25 22:29:44 CET 2004 packagename/subpackage/
smk   1972 Wed Feb 25 22:37:42 CET 2004 packagename/subpackage/Another.class


Method B) Pack the JAR file with the following command:
1  
jar -cf App.jar packagename/*

1  
2  
3  
jar -tf App.jar
packagename/Mainclass.class
packagename/subpackage/Another.class

Now jarsign it and verify it: everything is fine!

So the additional empty package names (=folders) in the JAR file of case A) cause the trouble? Why?

When I use the "-C" command for packing a JAR file, the folder names are always being included, and so the jarsigning fails. :-(
Offline Bombadil

Senior Member





« Reply #1 - Posted 2004-02-28 05:04:32 »

Would anybody who use Webstart JARs successfully like to test the following (takes less than 30 secs :-) ?

* jar -cf Test.jar a_small_folder

* jarsigner Test.jar Yourkey

* jarsigner -verify Test.jar

Does it report an error then?

{Edit: Corrected from jarsign to jarsigner :-}
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2004-02-28 06:06:09 »

Presumably you mean "jarsigner" not "jarsign". If so, it works fine for me. No errors reported.

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Bombadil

Senior Member





« Reply #3 - Posted 2004-02-28 06:52:52 »

Quote
Presumably you mean "jarsigner" not "jarsign".

Yes, you're right. Edited. :)

Quote
If so, it works fine for me. No errors reported.

Interesting...

With JDK v1.4.2 I get the message:
Quote

Note: This jar contains unsigned entries which are not integrity-checked. Re-run with -ver
bose to list unsigned entries.

This means just the folder entries (taking 0 bytes). I've just emptied the enire Webstart cache (manually) and tried to load my so signed JAR from Web and this time it worked (despite the above quoted "jarsigner -verify" message...)

Well well... verstehe wer will.
Offline Bombadil

Senior Member





« Reply #4 - Posted 2004-03-12 17:29:07 »

Sigh, problem solved by installing the newest Java 1.4.2_04 version...

Changelog states :
...
4931281       Regression: jarsigner fails to verify the jar files
...

Now everything works fine.
Offline Bombadil

Senior Member





« Reply #5 - Posted 2004-04-20 17:13:42 »

And now it's there again.
The installation of the mentioned new Java version solved the problem for some time.

I guess I am the only one with that problem...?
(But hey, as my quoted Java 1.4.2_04 changelog shows, it solved the bug I've been seeing; so there has been a problem...)
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #6 - Posted 2004-04-21 13:27:55 »

How many versions of java do you have installed?  Are you sure it's using the correct one?

Have you installed the 1.5 beta?  Because the last time I checked it I had problems with jarsigner.

Apart from that I don't really have any ideas Sad

Will.

Offline Bombadil

Senior Member





« Reply #7 - Posted 2004-04-21 14:15:02 »

Quote
How many versions of java do you have installed?  Are you sure it's using the correct one?

Have you installed the 1.5 beta?  Because the last time I checked it I had problems with jarsigner.

Apart from that I don't really have any ideas :(

Will, thanks for your reply. It helped my a lot - indirectly. :-)  

I'm using one Java version, the latest release version of Java 1.4.2. However since the jarsigner problem has been removed with this version I made some further tests now (because I know it worked some weeks ago) and now I found the problem:
In case there's a single file with non Ascii chars in its filename, which you include into your jar file, the command "jarsigner -verify bla.jar" fails, and so does Webstart. :-(
Is this a Jar bug? OK, it's a not a big problem to avoid non-ascii chars in files to be included with your Webstart jar file, but because no error is being printed when you pack the jar file, it can cause some time to find the problem...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (4 views)
2014-07-29 12:53:52

Dwinin (7 views)
2014-07-29 10:59:34

E.R. Fleming (20 views)
2014-07-29 03:07:13

E.R. Fleming (8 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (51 views)
2014-07-17 23:47:54
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!