• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create the stub class using rmic

 
kalpana Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
kalpana Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic