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.ConnectException 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 "java.rmi.ConnectException" Watch "java.rmi.ConnectException" New topic
Author

java.rmi.ConnectException

tun zaw
Greenhorn

Joined: Jan 23, 2008
Posts: 22
hi all

i have some problem with RMI.
java.rmi.ConnectException: connection refused to localhost;nested exception is:
java.net.ConnectException:Connection refused:connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket ........


at sun.rmi.registry.RegistryImpl_Stub.lookup(Uknown Source)
at java.rmi.naming.lookup(Naming.java:84)
at empentry.actionPerformed(empentry.java:113)


empentry.java:113 is Naming.lookup("//localhost:1097/EmpManager")

please help me.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi there,

* Is port 1097 already in use?
* Is there something actively listening at localhost:1097/EmpManager?
* I'm also not sure that your lookup path of //localhost:1097/EmpManager is 'correct', you might need to have a rmi: at the start of it e.g. rmi://localhost:1097/EmpManager


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
tun zaw
Greenhorn

Joined: Jan 23, 2008
Posts: 22
when i run my code, error occur in "//localhost:1097/EmpManager".
EmpManager is an interface.I don't understand following error " at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)".

Error occur in line "Naming.lookup(//localhost:1097/EmpManager)".

What is i should place in "EmaManager".Interface or server class or other.
EmpManager is an interface in my code.

I use SQLServer 2000 database server. Any other error not occur in my code.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Originally posted by tun zaw:
when i run my code, error occur in "//localhost:1097/EmpManager".
EmpManager is an interface.I don't understand following error " at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)".

Error occur in line "Naming.lookup(//localhost:1097/EmpManager)".

What is i should place in "EmpManager".Interface or server class or other.
EmpManager is an interface in my code.


If you look at your stack trace you can see that it's a "connection refused to localhost error". That usually occurs because your lookup path is incorrect or that the port is in use. Are you able to answer my earlier questions?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.rmi.ConnectException