wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes Java Naming.rebind() issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Java Naming.rebind() issue" Watch "Java Naming.rebind() issue" New topic
Author

Java Naming.rebind() issue

Lucian Tarna
Greenhorn

Joined: Nov 02, 2013
Posts: 3
I have a big problem with my code it seems. I get this :
java.rmi.ConnectException: Connection refused to host: 5.12.78.59; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at Server.main(Server.java:9)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:340)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:177)
at Server.main(Server.java:9)
at __SHELL7.run(__SHELL7.java:6)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at bluej.runtime.ExecServer$3.run(ExecServer.java:725)



on the code below:
public class Server {
public static void main(String[] args) throws Exception {

Generator Ob = new Generator();
System.out.println("1");
Naming.rebind("rmi:///Ob",Ob);

System.out.println("Serverul s-a legat la" +
" registrul RMI");
}
}

Generator is defined correctly yet when i do Naming.rebind it all falls apart , why ? Thank you for your help.

if you want me to post or link the whole source do bot hesitate to tell me:P
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3827

You would need to provide more context in to this perhaps with sample code related to the same.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Lucian Tarna
Greenhorn

Joined: Nov 02, 2013
Posts: 3
Well here is the whole thing. I was reluctant to put it up since i didn't have the chance to compile it. I am ashamed of the mistakes you will find ) but here you go :P
Also i am trying to start it with cmd
I go D:\java\bin rmiregistry , end then C:\Desktop\CalculatorProiect java Server.java i am not doing this right am i ?
Lucian Tarna
Greenhorn

Joined: Nov 02, 2013
Posts: 3
THe code :


it doesn't let me put .rar files





 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Java Naming.rebind() issue