aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI does not work" Watch "RMI does not work" New topic
Author

RMI does not work

Gabor Kovesdan
Greenhorn

Joined: Mar 20, 2011
Posts: 27

Hi,

I've basically completed my assignment, there's only one nit that fails. I export my stub in the following way:



The RMI registry is running on the standard port, service is properly initialized and config.getListenPort() returns a legal value but I got the following exception:



The referred line is that of registry.rebind(). I don't understand why it cannot found the class. The package is imported and even if I explicitly specify its location with -cp, same error occurs.

Any hints?

Thanks in advance.


Sun Certified Java SE 6 Programmer
Oracle Certified Professional, Java EE 5 Web Component Developer
Oracle Certified Professional, Java EE 5 Business Component Developer
Oracle Certified Professional, Java EE 5 Web Services Developer
Oracle Certified Professional, MySQL 5.0 Developer
Oracle Certified Professional, MySQL 5.0 Database Administrator
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5597
    
  15

Gabor Kovesdan wrote:The package is imported and even if I explicitly specify its location with -cp, same error occurs.

What do you mean with "the package is imported"?

Don't forget you are not allowed to set any other command line arguments than the one specified in the instructions (alone, server, <nothing>)


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Gabor Kovesdan
Greenhorn

Joined: Mar 20, 2011
Posts: 27

I just meant the proper import statement is there, although that's trivial because it wouldn't have compiled without it.
As for -cp, yes, I know, it was just an idea to try... I used to work with RMI and that time it just worked. I also googled a lot and checked tutorials but I don't know why is there this strange exception.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5597
    
  15

And what happens if you try to follow (and run) the RMI tutorial example? You should be able to get that one running and then you can compare with your own solution and see what's different.

Good luck!
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2268
    
    3

Howdy, Gabor.

Champ, try the following:



Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Gabor Kovesdan
Greenhorn

Joined: Mar 20, 2011
Posts: 27

Thanks a lot, Roberto, it works with createRegistry(). Your post also helped me to realize that I misinterpreted the port setup. Now I only have to polish some nits and write the documentation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI does not work