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 java.rmi.NotBoundException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "java.rmi.NotBoundException:" Watch "java.rmi.NotBoundException:" New topic
Author

java.rmi.NotBoundException:

Rob Brew
Ranch Hand

Joined: Jun 23, 2011
Posts: 100
Hi all.

I'm getting the above error message. Rmiregistry is running, and i've run rmic on the Sever class, MyRemoteImpl.

Code is below: where am i going wrong?


Server:



Cleint:
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Don't know, but I shall try duplicating this query in the “remote” forum in the hope of attracting more attention.

[edit]The forum is called “distributed” not “remote”[/edit]
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

where is the

lines?
and on client side

server DOES NOT NEED Naming.rebind();

Hope this works. Otherwise post a reply.

-Supun


Are you better than me? Then please show me my mistakes..
Rob Brew
Ranch Hand

Joined: Jun 23, 2011
Posts: 100
Still having problems:


Server side:


When the server is running with the changes you suggested.

Thanks,
Rob.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
Moving to our remote distributed Java forum.
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

Rob Brew wrote:Still having problems:


Server side:


When the server is running with the changes you suggested.

Thanks,
Rob.


Did you run the server first?
need more details.
please post entire exceptions.(stackTrace)
or
please email your project to supunlakshan.071@gmail.com

I promise that i WILL NOT publish your project.

-Supun
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

Does your whole program has this format?
To test this just copy and save them with provided class name (hope you get what i meant).

Common - both server and client needs this class

Server Side - Only Server needs these two classes RemoteObject, ServerMainClass


Client Side - Only Client needs these two classes ServerConnector, ClientMainClass



You may implement the programme as you wish.

First run ServerMainClass
Then run ClientMainClass.

You will get following on Client console
"Successfully Invoked Method1"

You will get following on Server console
"Successfully Invoked Method3"
"Successfully Invoked Method2"

Hope this will help

-Supun
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

I've got your mail and fixed it.
here is your code

here is the solution


The error was in for-loop in go() method.

in your for loop 2nd execution Socket clientSocket = serverSock.accept(); line waits for another Client.

so it won't execute


block. that means server is NOT started.

It is equals to you run the client first instead of server.

So palace above code before for loop and Replace with fixed the problem
Supun Lakshan Dissanayake
Ranch Hand

Joined: Oct 26, 2012
Posts: 133

If you still have problems, feel free to contact me.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.rmi.NotBoundException: