Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Stub Class Not Found Exception  RSS feed

 
Renjith mohanan
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
 
Nitesh Kant
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"
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!