• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Stub Class Not Found Exception  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to execute a simple RMI program.
But when I try to run the sever it is giving me the exception



I will put my classes here.
This is the Remote Interface

This is the Server program



I have used the rmic to create the stub file and place the class file in the correct folder and started the rmi registry in the same path...

One more thing, I am using jdk 1.6, in this is there any need to use the rmic to create the stub file........

Please help me.

Thanks In Advance

Renjith M
 
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Renjith mohanan wrote:
One more thing, I am using jdk 1.6, in this is there any need to use the rmic to create the stub file........



No, since jdk 1.5, dynamic proxies will be used if no stub is found.

Renjith mohanan wrote:I have used the rmic to create the stub file and place the class file in the correct folder and started the rmi registry in the same path...


Can you clarify this statement? What do you mean by started the rmi registry in the same path?
Are the stub classes in the classpath of the registry?
 
Renjith mohanan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Nitesh,
Actually what I meant by "started the rmi registry in the same path", is
I have the .class file (for RemoteInterface and RemoteImplementation and the stub class file) in one directory, say C:/RMIPrograms/de/rmi
And then I opened the command line prompt and went to this path ( C:/RMIPrograms/de/rmi (in this de.rmi is the package name)) and type rmiregistry and press enter.

Yes, the stub class in the class file of the registry.

Waiting for your reply..

Renjith M
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Renjith mohanan wrote:
I have the .class file (for RemoteInterface and RemoteImplementation and the stub class file) in one directory, say C:/RMIPrograms/de/rmi
And then I opened the command line prompt and went to this path ( C:/RMIPrograms/de/rmi (in this de.rmi is the package name)) and type rmiregistry and press enter.



Does that add the stub class to the rmi registry classpath? See this article on how to set classpath

You would have to add "C:/RMIPrograms" to the classpath and not "C:/RMIPrograms/de/rmi"
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!