| Author |
RMI remote Exception
|
Farzane Arabi
Greenhorn
Joined: Mar 07, 2009
Posts: 2
|
|
I have some problem in working on java RMI in netbeans IDE6.0
when I run the server this exception is represented :
Remote exception: java.rmi.ConnectException: Connection refused to host: 192.168.73.68; nested exception is:
java.net.ConnectException: Connection refused: connect
It seems I have no permisson to port, and I dont know how I can activate the premission
I'll be thank ful if you help me
the code is as symple as below:
|
 |
Oscar Costa
Ranch Hand
Joined: Feb 05, 2009
Posts: 31
|
|
You started the rmiregistry?
Try this code from server side:
Look at official sun documentation http://java.sun.com/javase/6/docs/technotes/guides/rmi/index.html
|
"Do or do not... there is no try!" - Jedi Master Yoda
> SCJP 5 : SCWCD 5 : SCBCD 5 <
|
 |
Farzane Arabi
Greenhorn
Joined: Mar 07, 2009
Posts: 2
|
|
Thank you Oscar for your help,
I inserted your code but unfotunatly after debug this line:
"Remote serverStub = UnicastRemoteObject.exportObject(Server, 0);"
this exception represented:
"Remote exception: java.rmi.server.ExportException: object already exported"
It seems there is no need to export the object by insrting this line and and making an obbject of "SampleServerImpl" is enougth to export the Server object,
If there is any idea I'll be thankful
|
 |
Treimin Clark
Ranch Hand
Joined: Nov 12, 2008
Posts: 757
|
|
Farzane,
It's a bit difficult to read through your code. Please use code tags in future.
|
 |
Nitesh Kant
Bartender
Joined: Feb 25, 2007
Posts: 1638
|
|
Farzane Arabi wrote:
It seems there is no need to export the object by insrting this line and and making an obbject of "SampleServerImpl" is enougth to export the Server object,
Yeah you do not need to export it. UnicastRemoteObject constructor exports automatically.
Did you try to use the rmi registry as told by Oscar?
Naming requires the name to be in the format of a URL and not a simple name. See javadocs for details.
|
apigee, a better way to API!
|
 |
 |
|
|
subject: RMI remote Exception
|
|
|