• Post Reply Bookmark Topic Watch Topic
  • New Topic

rmi server jar

 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have developed a remote notepad applet but I have the following problem.

After the notepad was finished I made it a jar then sign it.

When I try to start the rmi server I get an error that a class (stub) has not been found, which is not correct since that class exists and in the correct path.

However if I have both the jar and the root of the package the application seems to work ok!

Any ideas why it is not working with the jar only?

Thank you in advance

Azul
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the command line options you use when you start your server? And any classpath system settings that may be set?

Are you setting the java.rmi.server.codebase property?
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and thnka you for the reply.

Before your reply i was not using the codebase argument. i was using the following command:

java -Djava.security.policy=policy -jar RServer.jar

after your reply i added the codebase as follows with the exactly same resutls. In the notepad directory i have another jar with the stubs...


java -Djava.security.policy=policy -Djava.rmi.server.codebase="file:///C:/notepad/" -jar RServer.jar

I also tried the following instead of file:/// i tried http://myComputersHostname:8080/notepad/

again with the same result.

Any suggestions ?

Thank you in advance.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you use a 1.5 or 1.4 compiler?
If the former you may try removing the stubclass completely and try again.
I've encountered the same error (stub not found when it's there) and removing the stub resolved it...
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I compiled it with 1.4 ...

I'll give it a try now and I'll come back with an asnwer


thanks for the reply.

pinda
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope it did not work ...

I even tried to package the stubs separatelly in another jar but it could not find them... either.

However it will work if i put the classes in directories... any ideas why?

Of course them the client will fail saying ClassCast Exception....

thank you in advance

Pinda
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after your reply i added the codebase as follows with the exactly same resutls. In the notepad directory i have another jar with the stubs...


Make the codebase the JAR file itself... not the directory.
 
Pinda Ros
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and thank you for the reply.

Actually the problem was java 1.4.2 itself...

with java 1.5 problem solved...

The problem was with signing applets and using signed stubs on the one side and non signed on the other, and something else with applets (known java bug)that i dont remember now. actually 2 java bugs

thnks again...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!