aspose file tools*
The moose likes Distributed Java and the fly likes How to create the stub class using rmic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "How to create the stub class using rmic" Watch "How to create the stub class using rmic" New topic
Author

How to create the stub class using rmic

kalpana Kumar
Ranch Hand

Joined: Jul 03, 2003
Posts: 65
Hi all,
I have a scenario in which I have a remote interface and interImpl.java and RMIServer.java which contains the main() method with naming.rebind().
Now I have to create the stub and skeleton.
I gave the command as rmic fullpathofinterimpl(c:/test/interImpl)
But I get the error class not found.
and then I gave rmic c:/test/RMIServer (this is the class contain main())
yet the same error
Then
rmic c:/test/interImpl RMIServer.
Yet same error.

Help needed pl
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You have to give rmic the class names... not a path to the class files.

It should probably look something like:


or


if interImpl is in the test package.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
kalpana Kumar
Ranch Hand

Joined: Jul 03, 2003
Posts: 65
Nathan,
Thanks a lot for replying. For now I used RMI plugin to generate the stubs but eventually I have to come up with a script.
The actual implementation is like this,
I have a seperate interface (not RMI one) and three classes implement this and they perform different operations. Again I have a diff RMI Interface and RMIImpl class which calls the above 3 defined calsses. So, now it is a bunch of classes not a single class as per my previous post. So in this scenario how should I create the stubs and skeletons?.
Say, I create a .jar file of all the classes and put the jar in the classpath later on,
how to proceed,
rmic test.jar?
I need help please.

Thanks
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I haven't tried it myself (because I've usually created the stubs , and then JARred the implementation classes and stub classes into the JAR all together), but I'm pretty sure that all you would do is specify the JAR file containing the implementation classes on the -classpath of rmic. Remember, in rmic you specify the classes that you want to create stubs of - not the class files. The path to the class files (whether a JAR or a directory) get listed as the -classpath property, then you specify the classes you want to create stubs from (remember - full class names - i.e. com.whatever.ClassName).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create the stub class using rmic