aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes How to deploy classses in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "How to deploy classses in RMI" Watch "How to deploy classses in RMI" New topic
Author

How to deploy classses in RMI

Bin Wu
Ranch Hand

Joined: Jan 03, 2001
Posts: 32
Who can tell me how to deploy classes in RMI?
I tested my application with putting all classes about client and server in a same directory, it is OK. But there are some errors when I try to deploy the client and server seperately. The main issue is failure to find the class FBNImpl_Stub.
Thanks in advance.
Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
I'm also having some problems with stub and skeleton. I thought we need to place stub on client side and skeleton on server side. But my application is not working without stub on server side.
Bin Wu
Ranch Hand

Joined: Jan 03, 2001
Posts: 32
Gautom,
I agree with you completely, and I also did as you said that put the stub physically in the both sides of client and server, but it is still no way. Can you and others tell me waht's wrong with my application? Thanks a lot.
Doug Melzer
Ranch Hand

Joined: Mar 23, 2000
Posts: 51
One approach is to make the .class files available via an HTTP accessible URL. If you just want to test locally, you could use a file:// based URL. Take a look at java.rmi.server.codebase which is used to tell RMI where to look for your .class files.
Bin Wu
Ranch Hand

Joined: Jan 03, 2001
Posts: 32
Three kinds of problems in different environment:
1. set classpath=null->change to the directory where can't find any class->start rmiregistry->set classpath to the classes of server including the stub->change to another directory to start sererv->error: java.rmi.ServerException:RemoteException occured in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: FBNImpl_Stub.
2. set classpath to the classes of server including stub->start rmiregistry->start server(server running OK)->set classpath to the classes either in the client or in the server->run client->
Error: Can't find FBNImpl_Stub (in fact, FBNImpl_Stub was placed in the directory of client physically)
3. set classpath to the classes of server including stub->start rmiregistry->start server(server running OK)->set classpath only to the classes in the client->run client->Error: java.lang.NoClassDefFoundError: FBN ( FBN is the common interface either in the client and server, it was actually put in the directory of the client)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to deploy classses in RMI