Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.rmi.ConnectException

 
tun zaw
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
tun zaw
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic