This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Basic RMI problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Basic RMI problem" Watch "Basic RMI problem" New topic
Author

Basic RMI problem

Stephen Cowell
Greenhorn

Joined: Feb 07, 2002
Posts: 22
Hi,
I've run into a weird problem and I can't find any old posts which address it.
I've created a "ConnectionFactory" class which extends UnicastRemoteObject and implements ConnectionInterface (which just declares a getConnection() method). The ConnectionFactory has a main method which instantiates a copy of itself and attempts to bind itself to the registry using Naming.rebind(name,app). I don't attempt to create or locate the registry in my code.
Next I compile it all and do a rmic on it and the stub files are created no problem. I then start the registry and then attempt to run the ConnectionFactory. However the problem is that seems to get stuck (ie doesn't through an exception, just hangs there) at the point in the line of code where it call Naming.rebind.
Any idea why?
Thanks.

My development environment is Linux.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I am going to ask you a silly question. Do you call printStackTrace() inside the catch block to display any exception thrown because of the rebind() method?
Also try the following command before you start the rmiregistry:
set CLASSPATH="parent directory for all your packages".
Stephen Cowell
Greenhorn

Joined: Feb 07, 2002
Posts: 22
Thanks for the reply.
Yes I do catch and print any exception. Here's the code


the last line of the output is "ConnectionFactory name = rmi://localhost:1099/ConnectionFactory
I tried the classpath option but it didn't seem ot make any difference.
[ April 16, 2002: Message edited by: Stephen Cowell ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic RMI problem
 
Similar Threads
RMI Registry help
Please help me feel confident with my design ...
RMI Question another one ?
RMI Testing
Stupid deployment question - Again!