Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RMI does not work

 
Greenhorn
Posts: 27
Firefox Browser MySQL Database BSD
  • 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.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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
Firefox Browser MySQL Database BSD
  • 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: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • 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!
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy, Gabor.

Champ, try the following:

 
Gabor Kovesdan
Greenhorn
Posts: 27
Firefox Browser MySQL Database BSD
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic