This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to create the stub class using rmic

 
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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • 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 Spring Java
  • 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).
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic