This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Startup question: with or without jar-file

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am using RMI and I read the book Complete Java 2 Certification Study Guide and the guys suggested to deliver a server.jar and client.jar file with automatic start of the main server/client class. This looks like:
java -Djava.rmi.server.codebase=file:/<path>/ -Djava.rmi.server.hostname=<hostname> -Djava.security.policy=policy -jar server.jar
and
java -Djava.rmi.server.codebase=file:/<path>/ -Djava.security.policy=policy -jar client.jar
Now the problem is that the server is throwing a ClassNotFoundException in the Stub class because its not in the path specified by me. Indeed its in the server.jar file. Is there a solution, or do i have to do it without jars?
Thanks
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have the stub classes in both the client and server jar. It's needed by both.
------------------
I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!