File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI does not work

 
Gabor Kovesdan
Greenhorn
Posts: 27
BSD Firefox Browser MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Roel De Nijs
Sheriff
Posts: 9208
78
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>)
 
Gabor Kovesdan
Greenhorn
Posts: 27
BSD Firefox Browser MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 9208
78
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2271
3
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Gabor.

Champ, try the following:

 
Gabor Kovesdan
Greenhorn
Posts: 27
BSD Firefox Browser MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic