RMI connection refused

Hello to all,
I have created and completed an RMI chat application and tested it on my localhost. It worked all right.
Now I want to make it live i.e. run it through internet.
Is it same as running on localhost only we have to change the IP address for locating registry.
I have done that and uploaded the server file on host, also I have the IP address of that host.
I have replaces localhost whit the give IP address but connection refused exception is thrown.
I have located the registry on the server through IP address then when I use
Registry reg=LocateRegistry("xx.xx.xx.xxx");
System.out.println("1");
chatAppIF chatStub=(chatAppIF)Naming.lookup("rmi://xx.xx.xx.xxx:xxxx/service");
System.out.println("2");
int i=chatStub.logMeIn(user,pass);
System.out.println("3");Output screen shows
1
2
Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
        java.net.ConnectException: Connection refused: connectWhile when i use
Registry reg=LocateRegistry("xx.xx.xx.xxx");
System.out.println("1");
chatAppIF stub=(chatAppIF)reg.lookup("service");
System.out.println("2");
int i=chatStub.logMeIn(user,pass);
System.out.println("3");it give output as
1
Client exception: java.rmi.ConnectException: Connection refused to host: xx.xx.xx.xxx; nested exception is:
        java.net.ConnectException: Connection refused: connectIs there is difference between naming.lookup() and reg.lookup() method?
I think Naming.lookup() finds the registry but cannot find the method logMeIn() while reg.lookup() has no success.
anyway why the connection is refused?

The argument to Naming.bind()/rebind()/unbind() and Naming.lookup() is a URI of the form rmi://hostname[:port]/path.
The argument to Registry.bind()/rebind()/unbind() and Registry.lookup() is just the path part.
The data returned by Naming.list() is an array of URIs.
The data returned by Registry.list() is an array of paths.
In other words Naming.list() returns items which can be used as arguments to Naming.lookup(), and Registry.list() returns items which can be used as arguments to Registry.lookup().
The reason is that when you construct a Registry, via LocateRegistry.getRegistry(), you supply the host and port at that point, so specifying it again in the bind/lookup string would be redundant. There's nothing stopping you doing that but the resulting name won't be compatible with what Naming.bind() would have done.

Similar Messages

  • RMI: connection refused error while invoking remote method from client mac.

    Hi All,
    when i run client program, which is calling remote object from other system, it shows the below error.
    please help me solving this issue, i also have policy file and installed security manager.
    Exception in Cliendjava.rmi.ConnectException: Connection refused to host: 10.66.
    112.137; nested exception is:
    java.net.ConnectException: Connection refused: connect
    thanks in advance.
    Regards,
    Anand.

    See item A.1 of the [RMI FAQ|http://java.sun.com/j2se/1.5.0/docs/guide/rmi/faq.html].

  • RMI Connection Refused through Firewall

    Hi,
    I am having problems making an RMI connection through a firewall. On the server outside the firewall I have my servlet application running in an OC4J container and inside the firewall I have an EJB listening on port 6666. I have setup the firewall to allow connections through on port 6666. If I telnet from the machine outside the firewall on port 6666 I am able to make a connection to the EJB. So I know the firewall has been setup to handle the connection.
    I run the servlet application and when it tries to make the connection it gives an error:
    javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused; nested exception is:
    java.net.ConnectException: Connection refused
    When I do a snoop on the external machine to see what data is trying to be sent to the internal machine there is no data. When doing the telnet test there was data.
    I have the same servlet application deployed on a machine internally and it is able to make a connection to the EJB. The only problem is either the configuration of the application server on the external machine or the firewall configuration.
    Anyone able to help me see what I am missing?
    Thanks
    Shawn Clark

    not sure what you mean by having a 'EJB listening' on port 6666. Do you mean actually having a socket listening within the EJB code? If so then that is a suspicious EJB activity.
    If not then i guess you mean the ORMI listening port of the OC4J application. This is normally set on port 23791 to allow the RMI communication to flow.
    -lp

  • Java.rmi.ConnectException: Connection refuse

    Hi all,
    I have built a simple RMI client server application.I can run client & server fine locally.
    However if I test this appplication over the internet, I get this exception on the client:
    java.rmi.ConnectException: Connection refused to host: 169.254.157.53; nested exception is:
    java.net.ConnectException: Connection timed out: connectConnection refused to host:169.254.157.53
    The RMI server is running on my PC and the client on a friend's remote PC.Both PCs are connected to Internet.
    I don't have any firewall running on my PC (including windows XP firewall). The server RMI lookup on the client happens correctly,
    the exception is raised when the client tries to call the remote method on the server.
    Here is an extract of my RMI server code (it works locally):
    public static void main(String[] args) throws Exception {
              try {
              // args[0] contains the database server name given as command line argument, arg[1] contains binary path that contains weather jpeg files     
              CPrimaryWeatherServer test = new CPrimaryWeatherServer(args[0], args[1]);
              Naming.rebind("rmi://localhost:1099/WeatherPrimaryService", test);
              System.out.println("Serveur m�t�o principal d�marr�");
              } catch (Exception e){ System.out.println(e.getMessage());}
    Here is an extract of my RMI client code (it works locally):
    try{
                        rec=1;
                        leftClik=1;
                        System.out.println("Before RMI lookup");
                        IPrimaryWeatherServerService serveur =(IPrimaryWeatherServerService)Naming.lookup("rmi://"+primWS+":1099/WeatherPrimaryService");
                        System.out.println("After RMI lookup");
                        System.out.println("Before server method call");
                        z=serveur.getFullWeatherData(); --> exception is raised here
                        System.out.println("After RMI server method call");
    I am directly connected to Internet using an ethernet card connected to an ADSL modem.169.254.157.53 is the automatic IP of my network card different from the IP given by my ISP. By the way, the client tries to contact me using my DNS name that resolves correctly to my ISP IP adress.
    Thanks a lot for help,

    because I am guessing that a local IP address is being embedded into the stub so the clien't can't find the remote server. I am guessing because you didn't provide the exception or its text. Anyway the suggestion will cause the correct public IP address/hostname to be embedded into the stub.

  • RMI Callback Connection Refused Problem

    we are running Red Hat Linux 9, we previously had a problem connecting a server and client running in 2 different PC's. we had the following error
    Exception in mainjava.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
    java.net.ConnectException: Connection refused
    we used the -Djava.rmi.server.hostname= <hostname> option to make it run. Now, were trying to make use of call backs this time we ran into another problem having the error:
    Exception in mainjava.rmi.ConnectException: Connection refused to host: 172.16.100.24; nested exception is:
    java.net.ConnectException: Connection refused
    what are we doing wrong?

    We already included a security manager. but the error is still there.

  • Rmi client throws Connection Refused exception

    My Rmi client throws a Connection Refused exception when i try to run it on remote machine (in this case i run it on my virtualbox macine).
    The virtualbox machine network is in NAT mode (host machine ip should be 10.0.2.2).
    When rmi client starts get registry instance and print in standar output:
    RegistryImpl_Stub[UnicastRef2 [liveRef: [endpoint:[//10.0.2.2/:1099,util,RmiInstances$1@1275d39](remote),objId:[0:0:0, 0]]]]But when rmi client trys to use any of remote methods it throws Connection Refused, but it's to strange because the Connection Refused has 127.0.1.1 as ip.
    java.rmi.ConnectException: Connection refused to host: 127.0.1.1; ....In client RmiInstances code (this class contains all remote implementations) is:
    public class RmiInstances {
        private static RmiInstances instance;
        private IUserManage userManage;
        private IAnalysis analysis;
        private IPacientManage pacientManage;
        private IInsuranceManage insuranceManage;
        private Config config;
        private RmiInstances()
                throws RemoteException, NotBoundException, IOException {
            this.config = Config.getInstance();
            Registry registry = LocateRegistry.getRegistry(config.getServerUrl()+"/",
                    1099, new RMIClientSocketFactory() {
                @Override
                public Socket createSocket(String host, int port) throws IOException {
                    try {
                        URI uri = new URI(config.getServerUrl()+
                                ":"+config.getServerPort());
                        return new Socket(uri.getHost(), uri.getPort());
                    } catch (URISyntaxException ex) {
                        ex.printStackTrace();
                        return null;
            System.out.println(registry);
            userManage = (IUserManage)registry.lookup("RUserManage");
            analysis = (IAnalysis)registry.lookup("RAnalysis");
            pacientManage = (IPacientManage)registry.lookup("RPacientManage");
            insuranceManage = (IInsuranceManage)registry.lookup("RInsuranceManage");
    ...And server code is the next:
    public static void main(String[] args) {
         System.out.println("GNULab Server " + VERSION + " starting...");
         System.setProperty("java.rmi.server.codebase",
              "file:/home/zarovich/workspace/labserver/bin");
         try {
             // Loading config
             System.out.println("Loading config...");
             Config config = Config.getInstance();
             // inicializando rmi registry
             Registry registry;
             if (config.isSsl()) {
              registry = LocateRegistry.createRegistry(
                   config.getServerPort(), new RmiSSLClient(),
                   new RmiSSLServer());
             } else
              registry = LocateRegistry
                   .createRegistry(config.getServerPort());
             // instanciando implementaciones
             RAnalysis rAnalysis = new RAnalysis();
             RInsuranceManage rInsuranceManage = new RInsuranceManage();
             RPacientManage rPacientManage = new RPacientManage();
             RUserManage rUserManage = new RUserManage();
             // registrando interfaz rmi
             registry.rebind("RAnalysis", (IAnalysis) UnicastRemoteObject.exportObject(rAnalysis, 0));
             registry.rebind("RInsuranceManage", (IInsuranceManage) UnicastRemoteObject.exportObject(rInsuranceManage, 0));
             registry.rebind("RPacientManage", (IPacientManage) UnicastRemoteObject.exportObject(rPacientManage, 0));
             registry.rebind("RUserManage", (IUserManage) UnicastRemoteObject.exportObject(rUserManage, 0));
             System.out.println("GNULab Server " + VERSION + " listening ...");
             System.out.println("Registry instance: " + registry.toString());
         } catch (RemoteException e) {
             e.printStackTrace();
            * catch (MalformedURLException e) { e.printStackTrace(); }
            */catch (IOException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         } catch (JDOMException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
    ...

    I'm solved my problem.
    I just need run my server with -Djava.rmi.serverhost=10.0.2.2 and my client running on my virtualbox machine works!

  • RMI Protocol over JRMP transport: connection refused

    I changed the look and feel for disco plus to Jinitiator. I then started getting error RMI Protocol over JRMP transport: connection refused to host: 192.168.1.1
    I changed the settings back to java plugin 1.4 but I'm still getting the same error on all client machines.
    I'm running windows 2003 and application server 10.1.2.0.2
    Thanks for any help,
    Brian

    Hi Brian
    When you changed to JInitiator what did you set the style to be? Also, why would you not want to use the Sun Java?
    Anyhow, try getting the users to clear their local Sun Java cache, this will release the applet causing it to reload upon next connection, and try again.
    If you want to retry JInitiator, try this:
    1. Go to Control Panel | JInitiator 1.3.1.x or whatever version you are using
    2. Navigate to the Proxies tab
    3. Uncheck Use Browser Settings
    4. Click the Apply button
    5. Close all browser windows
    6. Reconnect to Discoverer Plus
    If the above steps do not help, try editing the security details of the Options menu in the Internet Explorer using this workflow:
    1. On the client machine, launch IE
    2. From the toolbar, select Tools | Internet Options
    3. Navigate to the Security tab
    4. Click on the Trusted Sites icon
    5. Click on the Sites button
    6. Add a fully, qualified HTTP link to your server
    7. Close all browser windows
    8. Reconnect to Discoverer Plus
    Of the two solutions above, the first is most likely to fix your issue. However, I advise all my customers to set up the application server connections as being trusted sites.
    One additional thing would be to delete your cookies. Discoverer Plus loves cookies.
    Best wishes
    Michael

  • RMI Protocol over JRMP transport: connection refused to host: 10.10.10.10

    Hi,
    We migrated our Discoverer 9.0.2 to 10.1.2. However, when we connected to Discoverer Plus, the message saying "RMI Protocol over JRMP transport: connection refused to host: 10.10.10.10" appeared. We use the "Default" communication protocol and Sun JVM 1.4+ is installed in the client. Do you know what's happening?
    Thanks.
    Andy

    Hi Andy
    It could be a Java incompatibility issue. On one of your client machines try removing Java altogether and then reconnecting to Discoverer Plus. The server should send down a new, clean version of the Java.
    Try this and let me know how you get on
    Best wishes
    Michael

  • Java.rmi.ConnectionExceptionException:Connect refused to host

    I write a rmi,when server and client runs in the same machine,it runs ok,then I run them in two machines,server runs in 192.168.0.1,like follows:
    C:\>rmiregistry -J-Djava.security.policy=registerit.policy
    C:\>java -Djava.rmi.dgc.leaseValue=1000 -Djava.security.policy=registery.policy RegisterIt
    Object instantiated: HelloServer[RemoteStub [ref: [endpoint:[192.168.0.1:3120](l
    ocal),objID:[0]]]]
    and it ok ,client runs in 192.168.0.2, but it raise errors:
    java -Djava.security.policy=registerit.policy HelloClient
    HelloClient exception :java.rmi.ConnectionException:Connection refused to host:192.168.0.2;nested exception is:java.net.ConnectException:Connection refused:connect
    Why? how to solve it?
    Any idea will be appreciated!
    My code is follows:
    HelloInterface.java
    public interface HelloInterface extends java.rmi.Remote{
    public String sayHello() throws java.rmi.RemoteException;
    HelloServer.java
    import java.io.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import java.util.*;
    public class HelloServer extends UnicastRemoteObject implements HelloInterface{
    public HelloServer() throws RemoteException{
    super();
    public String sayHello() throws RemoteException{
    return "Hello world, the current system time is "+new Date();
    RegisterIt.java
    import java.rmi.*;
    public class RegisterIt{
    public static void main(String args[]){
    try{
    HelloServer obj=new HelloServer();
    System.out.println("Object instantiated: "+obj);
    Naming.rebind("/HelloServer",obj);
    System.out.println("HelloServer bound in registery");
    catch(Exception e){
    System.out.println(e);
    registerit.policy
    grant{
    permission java.security.AllPermission;
    HelloClient.java
    import java.rmi.*;
    public class HelloClient{
    public static void main(String args[]){
    if(System.getSecurityManager()==null){
    System.out.println("null");
    System.setSecurityManager(new RMISecurityManager());
    try{
    HelloInterface obj=(HelloInterface)Naming.lookup("/HelloServer");
    String message=obj.sayHello();
    System.out.println(message);
    catch(Exception e){
    System.out.println("HelloClient exception: "+e);
    }

    Connection refused means the server is no listening on the port that client tried to connect to. You need to look at your configuration.

  • Invocation time Exception (java.rmi.ConnectException: Connection refused to

    Hi folks,
    SERVER = LINUX
    CLIENT = WINDOWS 200
    JAVA VERSION : 1.4.2
    Object obj = Naming.lookup("rmi://x.x.x.x:5578/MyServer");
    System.out.println("Object ="+obj); // Works fine and return stub as shown in o/p
    MyServer_Stub server = (MyServer_Stub)obj;
    server.validate(); // throws following Connection refused exception
    -----OUTPUT-----
    Object =com.MyServer_Stub[RemoteStub [ref: [endpoint:[x.x.x.x:42360](remote),objID:[a981ca:10722cb9411:-8000, 0]]]]
    java.rmi.ConnectException: Connection refused to host: x.x.x.x.x; nested exception is:
         java.net.ConnectException: Connection refused: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
         at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)[
         at com.MyServer_Stub.validate(Unknown Source)/b]
         at tescasees.testbyexample.rmi.MyServerChangesTestApplication.main
    Caused by: java.net.ConnectException: Connection refused: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
         at java.net.Socket.connect(Socket.java:452)
         at java.net.Socket.connect(Socket.java:402)
         at java.net.Socket.<init>(Socket.java:309)
         at java.net.Socket.<init>(Socket.java:124)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
         ... 5 more
    Exception in thread "main"
    [b] Why does java system throws exception at invoke time not connection time at lookup time</b]
    Any suggestion...
    Regards,
    Manoj

    > Are you getting this from a lookup()? If so it means the Registry you are looking for at rmi://x.x.x.x:5578 is not present.
    I am getting it at the time when I invoke the method validate on the object returned from lookup.
    --Manoj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • WCS 4.0 - Error: RMI FATAL ERROR. ERROR DETAIL: Connection Refused

    Have observed the following software defect in WCS 4.0:
    When clicking on a Mac Address link in a list of client MAC addresses, the following error is displayed: "Error: RMI FATAL ERROR. ERROR DETAIL: Connection Refused". The same error occurs when clicking on the MAC address URL within a list of rogue APs.
    Is this a configuration issue or a software defect?
    For reference, the WCS/WLC configuration is as follows:
    =======================================================
    WCS Version 4.0.81.0 Base+Location
    Windows 2003 with WCS running as a service.
    Multi-processor Xeon, 8 GB of RAM.
    Two 4404 WLC controllers v4.0.179.8

    This is one to use TRACE level debugging, and a repeated process, to analyse the WCS logs for possible problem
    identification.

  • Connection Refused -RMI over the internt

    Hi All
    I have been looking at posts in the forums to solve my problem and now reached a kind of dead end hope someone can help.
    I have this RMI application that was desigend to run over a network and it works fine.It was decided that it should be used over the internet. Running as is started the problems ( as expected)
    what happened initially was that client would make a connection to the server but would throw an exception when server tried to callback the client.
    The forums solution was to have 2 ports opened ( like 1098 and 1099) and connect which I did. This caused a new problem now the client itslef throws a connection exception.
    This led me to belive that there would be a networking issue but the netadmin reports that he is seeing traffic reach the server and packets sent back. However I see an exception that is Connection refused to host : <IPADDRESS OF THE SERVER> :connection timed out
    Any help would be much appreciated
    Thanks

    I followed ejp's instructions and everything worked perfectly. Here is a bit more detailed explanation of what I did.
    I've been having various problems implementing an RMI Server/Client architecture, with Client Callbacks. My scenario is that both Server and Client are behind Firewall/NAT. In the end I got a fully working implementation. Here are the main things that I did:
    Server Side , Local IP: 192.168.1.10. Public (Internet) IP 80.80.80.10
    On the Firewall/Router/Local Server PC open port 6620.
    On the Router/NAT redirect incoming connections on port 6620 to 192.168.1.10:6620
    In the actual program:
    System.getProperties().put("java.rmi.server.hostname", IP 80.80.80.10);
    UnicastRemoteObject.exportObject(this, 6620);
    Client Side, Local IP: 10.0.1.123 Public (Internet) IP 70.70.70.20
    On the Firewall/Router/Local Server PC open port 1999.
    On the Router/NAT redirect incoming connections on port 1999 to 10.0.1.123:1999
    In the actual program:
    System.getProperties().put("java.rmi.server.hostname", 70.70.70.20);
    UnicastRemoteObject.exportObject(this, 1999);
    Hope this helps.
    Iraklis

  • Connection refused in RMI

    Hi everybody,
    I am trying to run a java application in a distributed environment using linux m/cs.I tested the application using a single machine successfully but whenever i am trying to run my application among several machines then things are going wrong.I am facing a problem regarding java RMI.
    The commands i have given are:
    rmiregistry -J-Djava.security.policy=.java.policy & {.java.policy is my policy file}
    java -Djava.security.policy=.java.policy [arguments]
    i disabled the firewall and placed all the class definitions in the local classpath in all machines.
    i placed the policy file(.java.policy) in usere's directory.
    It looks like:
    grant {
    permission java.security.AllPermission;
    permission java.net.SocketPermission "*", "accept, connect, listen, resolve";
    The problem is Whenever i am trying to lookup the remote object from a remote machine,most of the time it fails giving following error.
    java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
    .............With some more error..............
    one thin more I didn't use localhost address(127.0.0.1) as the argument anywhere in the code and i am not getting the reason why the error is coming involving 127.0.0.1. . I only used real network ddresses like(192.168.9.45, or...)in the program and according to the code it should try to connect to some real network address but it is giving error involving 127.0.0.1.
    So what should i do? Even i have tried with a very simple code to fetch the remote object in a test application under the same environment but it is giving the same error.
    Pls help.

    OK, just found this myself after several hours of frustration...
    Check your /etc/hosts file on the server, and remove any line linking the loopback ip address (127.0.0.1) to localhost (or anything else).
    Your machine should I think have a static IP address for that to work properly elsewhere in the system.
    After that, restart the RMI server and try again.
    That did it for me.

  • Connection refused to host: connection timed out

    I have been struggling with this problem a couple of days now so I really hope someone can help me. I am trying to get rmi to work in a NAT environment. We use a firewall, so I have opened port 1099 and 2020 which I use as a fixed port for communication (just to be sure it is not a firewall thing); I use the following code:
    //server
    public class ComputeEngine extends UnicastRemoteObject
    implements Compute
    public ComputeEngine() throws RemoteException {
    super();
    public String getMessage() {
    return "you have successfully connected to the server";
    public static void main(String[] args) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    String port = args[0];
    try {
    RMISocketFactory.setSocketFactory(new FixedPortRMISocketFactory(Integer.parseInt(port)));
    } catch (IOException e) {
    e.printStackTrace();
    LocateRegistry.createRegistry( 1099 );
    catch (RemoteException e1) {
    e1.printStackTrace();
    String name = "rmi://localhost/Compute";
    try {
    Compute engine = new ComputeEngine();
    Naming.rebind(name, engine);
    System.out.println("ComputeEngine bound");
    while(true); //stay alive
    } catch (Exception e) {
    System.err.println("ComputeEngine exception: " + e.getMessage());
    e.printStackTrace();
    public Socket createSocket(String host, int port)
    throws IOException {
    System.out.println("creating socket to host : " + host + " on port " + port);
    return new Socket(host, port);
    * Create a server socket on the specified port (port 0 indicates
    * an anonymous port) and writes out some debugging info
    * @param port the port number
    * @return the server socket on the specified port
    * @exception IOException if an I/O error occurs during server socket
    * creation
    * @since JDK1.1
    public ServerSocket createServerSocket(int port)
    throws IOException {
    port = (port == 0 ? portnumber : port);
    System.out.println("creating ServerSocket on port " + port);
    return new ServerSocket(port);
    //client
    public class ComputePi {
    public static void main(String args[]) {
    if (System.getSecurityManager() == null) {
    System.setSecurityManager(new RMISecurityManager());
    try {
    String name = "rmi://" + args[0] + "/Compute";
    Compute comp = (Compute) Naming.lookup(name);
    System.out.println("connected to server");
    System.out.println(comp.getMessage());
    } catch (Exception e) {
    System.err.println("ComputePi exception: " + e.getMessage());
    e.printStackTrace();
    I start the client with:
    java -Djava.security.policy=policy.all -jar client.jar 194.2.4.6:1099
    I start the server with:
    java -Djava.rmi.server.codebase="file:/C:\RMI\\server.jar" -Djava.rmi.server.hostname="194.2.4.6" -Djava.security.policy=policy.all -jar server.jar 2020
    As you can see I set the "-Djava.rmi.server.hostname" property which should be a solution to the NAT problem. However I keep getting the following exception!!??!!:
    ComputePi exception: Connection refused to host: 194.2.4.6; nested exception is:
         java.net.ConnectException: Connection timed out: connect
    java.rmi.ConnectException: Connection refused to host: 194.2.4.6; nested exception is:
         java.net.ConnectException: Connection timed out: connect
         at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
         at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
         at sun.rmi.server.UnicastRef.newCall(Unknown Source)
         at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
         at java.rmi.Naming.lookup(Unknown Source)
         at client.ComputePi.main(ComputePi.java:14)
    Caused by: java.net.ConnectException: Connection timed out: connect
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(Unknown Source)
         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
         at java.net.PlainSocketImpl.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.connect(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at java.net.Socket.<init>(Unknown Source)
         at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
         at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
         ... 7 more
    Can anyone help me with this, please??????
    kind regards,
    Christiaan

    Yes, i can ping it from the client.
    I have also noticed that when i run my server with the option -Djava.rmi.server.hostname=IP the applications stops automatically after a few minuts...
    I'm not using nothing about codebase. I have the stub and skel classes in server and client machines..
    I add the complete exception:
    Client exception: java.rmi.ConnectException: Connection refused to host: external_IP; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    java.rmi.ConnectException: Connection refused to host: external_IP; nested exception is:
    java.net.ConnectException: Connection timed out: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
    at example.hello.Server_Stub.sayHello(Unknown Source)
    at example.hello.Client.main(Client.java:55)
    Caused by: java.net.ConnectException: Connection timed out: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:426)
    at java.net.Socket.connect(Socket.java:376)
    at java.net.Socket.<init>(Socket.java:291)
    at java.net.Socket.<init>(Socket.java:119)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirect
    SocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMaster
    SocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
    ... 5 more

  • Management console connection refused

    When I tried to use the management console to connect to JRockit on another
    machine, I got the error at the end of this email. I downloaded a
    license, the application is definitely running and listening on 7091. Could
    someone provide some insight into this error?
    Thanks
    ava.rmi.ConnectException: Connection refused to host: 127.0.0.2; nested
    exception is:
    java.net.ConnectException: Connection refused
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
    at
    javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Ljava.lang.Object;)Ljavax.management.remote.rmi.RMIConnection;(Unknown
    Source)
    at
    javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2229)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:229)
    at
    com.jrockit.console.rjmx.RJMXConnection.setupServer(RJMXConnection.java:617)
    at com.jrockit.console.rjmx.RJMXConnection.connect(RJMXConnection.java:175)
    at
    com.jrockit.console.rjmx.RJMXConnectorModel.connect(RJMXConnectorModel.java:387)
    at
    com.jrockit.console.browser.BrowserAbstractNode.connectNode(BrowserAbstractNode.java:102)
    at
    com.jrockit.console.application.AllUIOperations$4.doAction(AllUIOperations.java:127)
    at
    com.jrockit.console.application.AllUIOperations.executeAction(AllUIOperations.java:664)
    at
    com.jrockit.console.application.UIOperation.actionPerformed(UIOperation.java:311)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at
    javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    at
    javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
    at workshop.core.plaf.JbMenuItemUI.doClick(JbMenuItemUI.java:640)
    at
    javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
    at
    javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:942)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    Caused by: java.net.ConnectException: Connection refused
    at
    jrockit.net.SocketNativeIO.connect(Ljava.io.FileDescriptor;Ljava.net.InetAddress;III)I(Unknown
    Source)
    at java.net.AbstractSocketImpl.doConnect(Ljava.net.InetAddress;II)V(Unknown
    Source)
    at java.net.PlainSocketImpl.doConnect(Ljava.net.InetAddress;II)V(Unknown
    Source)
    at
    java.net.PlainSocketImpl.connectToAddress(Ljava.net.InetAddress;II)V(Unknown
    Source)
    at java.net.PlainSocketImpl.connect(Ljava.net.SocketAddress;I)V(Unknown
    Source)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
    at java.net.Socket.connect(Socket.java:507)
    at java.net.Socket.connect(Socket.java:457)
    at java.net.Socket.<init>(Socket.java:365)
    at java.net.Socket.<init>(Socket.java:178)
    at
    sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at
    sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
    at
    javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Ljava.lang.Object;)Ljavax.management.remote.rmi.RMIConnection;(Unknown
    Source)
    at
    javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2229)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:229)
    at
    com.jrockit.console.rjmx.RJMXConnection.setupServer(RJMXConnection.java:617)
    at com.jrockit.console.rjmx.RJMXConnection.connect(RJMXConnection.java:175)
    at
    com.jrockit.console.rjmx.RJMXConnectorModel.connect(RJMXConnectorModel.java:387)
    at
    com.jrockit.console.browser.BrowserAbstractNode.connectNode(BrowserAbstractNode.java:102)
    at
    com.jrockit.console.application.AllUIOperations$4.doAction(AllUIOperations.java:127)
    at
    com.jrockit.console.application.AllUIOperations.executeAction(AllUIOperations.java:664)
    at
    com.jrockit.console.application.UIOperation.actionPerformed(UIOperation.java:311)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at
    javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
    Jeff

    I did that as well, but it doesn't change the error message beyond the IP address which is refusing the connection:
    Could not open Management Console for testfix.dhcp.isgenesis.com.
    java.rmi.ConnectException: Connection refused to host: 10.0.129.82; nested exception is:
         java.net.ConnectException: Connection refused: connect
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:574)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
    at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
    at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:229)
    at com.jrockit.console.rjmx.RJMXConnection.setupServer(RJMXConnection.java:616)
    at com.jrockit.console.rjmx.RJMXConnection.connect(RJMXConnection.java:194)
    at com.jrockit.console.rjmx.RJMXConnectorModel.connect(RJMXConnectorModel.java:209)
    at com.jrockit.mc.browser.views.JRockitBrowserToolkit.connect(JRockitBrowserToolkit.java:372)
    at com.jrockit.mc.console.ui.actions.StartConsole$1.preConnect(StartConsole.java:35)
    at com.jrockit.mc.browser.utils.PreConnectJob.run(PreConnectJob.java:56)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
    -- Caused by --
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
    at java.net.Socket.connect(Socket.java:516)
    at java.net.Socket.connect(Socket.java:466)
    at java.net.Socket.<init>(Socket.java:366)
    at java.net.Socket.<init>(Socket.java:179)
    at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
    at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:569)
    at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:94)
    at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown Source)
    at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2239)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:271)
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:229)
    at com.jrockit.console.rjmx.RJMXConnection.setupServer(RJMXConnection.java:616)
    at com.jrockit.console.rjmx.RJMXConnection.connect(RJMXConnection.java:194)
    at com.jrockit.console.rjmx.RJMXConnectorModel.connect(RJMXConnectorModel.java:209)
    at com.jrockit.mc.browser.views.JRockitBrowserToolkit.connect(JRockitBrowserToolkit.java:372)
    at com.jrockit.mc.console.ui.actions.StartConsole$1.preConnect(StartConsole.java:35)

Maybe you are looking for