• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot find class in a signed jar file  RSS feed

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I have a signed file that contains two classes

client/main.class
client/second.class

I have set the main class to be "main.class" in my jar file
this main class creates an object of second.class ...

but the problem i'm getting is NoClassFoundException and it points to the second.class!?



thats my command

C:\jones>java -cp c:\jones\compute.jar;c:\foo\client\mySignedFile.jar -Djava.security.policy=client.policy client.main
127.0.0.1


they are both in the signed file i've checked... thats what i get when i view the jar


And thats my Manifest.MF


what could be a problem?

Thanks
HannaH
[ July 21, 2008: Message edited by: H Melua ]
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does client.second have a dependency on the compute.jar? And if so, is that jar signed? My primary experience with signed JARs is with Java Web Start and Applets. And for those, all the secondary jars also need to be signed. I can't remember what error you get if they are not. I'm not sure if the same requirement holds for running signed jars directly. But, I'd try signing that compute jar as well and see if that resolves it for you.

As a secondary note, since your jar's manifest defines the main-class, instead of specifying the main class on the command line and the jar in the classpath, you can use the -jar switch to identify both. And if you add the compute.jar to the Manifest using the "Class-Path" attribute (and it can be specified as a relative path) you could then simply enter:

to run it. It keeps the command line simpler.


Let us know if that solves it. If not, perhaps someone else has some insight.
 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for replying

It doesn't apply to RMI because the compute.jar is defined by the server, and then used by the client... and so i shouldnt need to sign it myself... I need the permissions from the server...

I realised that i was missing the codebase , it was always there i dont know how it disapepared
Djava.rmi.server.codebase=file:/c:/jones/client


But now i'm having another trouble with permissions, but for this thread, it is solved

I was going to set the attribute, but when i first time attempted to change the manifest it said to me "invalid digest of message...", so i decided not to touch it again

Thanks a lot for your attempt
very much appreciated..
HannaH
[ July 22, 2008: Message edited by: H Melua ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!