File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes problem in rmi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "problem in rmi" Watch "problem in rmi" New topic
Author

problem in rmi

deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
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]
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
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

Joined: Jul 17, 2010
Posts: 33
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
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Did you shutdown the rmiregistry before you tried to start it again??

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


Regards, Rene Larsen
Dropbox Invite
deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
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

Joined: Jul 17, 2010
Posts: 33
but let say i want to register my service by the name "Remote Hello" with spaces, what should i do???
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
If you absolutely need the space then try using java.net.URLEncoder.
deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
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

Joined: Jun 01, 2010
Posts: 618
Here is an example:
deepak kushwaha
Ranch Hand

Joined: Jul 17, 2010
Posts: 33
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in rmi