This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

problem in rmi  RSS feed

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to use rmi on local host so i made three things first myremote interface:





2.) myremoteimpl class:








3.)and my remoteclient class :





i first compiled all classes ,then i used rmic to extract stub class from my myremoteimpl(it doesnt gave me skeleton class out); and then in other console started rmiregistry, and then started myremoteimpl.java , so that the server is up . but it gave me javamalformedexeption: invalid url string, what is the reason, i double checked all the things but couldnt resolve the problem.
please help


[NK: Please UseCodeTags]
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not done RMI in years so decided to try it. I was able to compile your code and reproduce your error. I removed the space between "Remote" and "Hello" as in the following code: and the error went away (actually it was replaced by another error but that's my problem :-). If you absolutely need the space then try using java.net.URLEncoder.
 
deepak kushwaha
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks tom for your reply, but this time when i removed the spaces and try to run rmi registry its giving me java.rmi.server.ExportExeption : listen failed on port 1099 , i cant understand what is the problem
 
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you shutdown the rmiregistry before you tried to start it again??

The code works if the space is removed - without any new errors.

 
deepak kushwaha
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rene Larsen wrote:Did you shutdown the rmiregistry before you tried to start it again??

The code works if the space is removed - without any new errors.



hey!! thanks it worked !!!
 
deepak kushwaha
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but let say i want to register my service by the name "Remote Hello" with spaces, what should i do???
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

If you absolutely need the space then try using java.net.URLEncoder.

 
deepak kushwaha
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i cant understand how to use that. i am not able to understand what this method saying. i mean i am unable to read the documentation.
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example:
 
deepak kushwaha
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!