Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI codebase

 
Mandy Yan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I met problems related to RMI.
I have prepared 2 jars, client.jar and server.jar which are the classes required to start client and server respectively.
Is that _Skel.class should only be included in client.jar while _Stub.class should only be included in server.jar? However, I found that I cannot run the client without _Stub.class in the client.jar.
I have tried to start a HTTP server and set the codebase to the HTTP directory containing the Stub when I start the server program. However, the client throws the following exception:
RemoteException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: suncertify.server.DatabaseServer_Stub
(no security manager: RMI class loader disabled)
Can anyone kindly give me some idea on my problem?
Thank you very much!
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The consensus in this group has been that you don't need to implement dynamic downloading, codebase, HTTP servers, security managers, or policy files for this assignment. Just package your stubs with the client, that's it.
Eugene.
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to generate _skel classes starting jsdk1.2. Like Eugene mentioned, you don't have to use codebase, RMI security manager or java.policy file for this assignment. If you like to use codebse, you have to go with only file URL and not HTTP server. Since you are supposed to develop a system which works across all the platforms, you have to write code to get the current directory and set the System property in side your code.
In my submission, I bundled _Stub files with the client.jar.
 
Mandy Yan
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much!
 
MJ Tang
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am at the point of implementing RMI too.
I will follow your point not to generate _skel classes, and not to have codebase, RMI security manager or java.policy file.
But what means that we have to write code to get the current directory and set the System property in side our code?
Appreciated if anybody could explain more.
Linda
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"lindamjt "-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Thanks! and welcome to the JavaRanch!
Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But what means that we have to write code to get the current directory and set the System property in side our code?

I don't know about setting any System properties. However you will need to get the current directory via
System.getProperty("user.dir");
Mark
 
MJ Tang
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Mark
I got it. Thanks.
Linda
 
ravindra janapreddy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to generate _skel classes starting jsdk1.2.
When I used rmic compiler to compile the server implementation we get both skelton as well as stub class.
Please point me to the location where I could refer to RMI with reference to jsdk1.2 .
Thanks
Ravi
 
ravindra janapreddy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have referred to tutorial on RMI on sun site.
In the Java 2 SDK implementation of RMI, the new wire protocol has made skeleton classes obsolete.
After you run rmic you should find the file Calculator_Stub.class and, if you are running the Java 2 SDK, Calculator_Skel.class.
My question is if we don't skelton class on server side i.e server side proxy how does the server handle the client request ? Would it be sufficient for me to just copy the stub class to the client side and let the client make the request to server through the stub? The server object shall inherently handle the incoming request itself.
Thanks
Ravindra
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic