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

Similar Messages

  • 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.

  • 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].

  • SFTP, FTP, HTTP Connection Refused through clients

    I have an off-site storage server that I've been using for a while. All of a sudden the past couple of weeks while trying to connect through Transmit or Cyberduck all I get is "connection refused" whenever I attempt to connect through SFTP, FTP, or HTTP. The IT guys for the server state it's fine but when I try to ping my ports on my mac my port 22 and 21 aren't visible.
    What in the heck is going on?

    Here is the log output for:
    ssh -v -v -v [email protected]
    What does ssh_connect: needpriv 0 mean?
    Brens-Mac-Pro:~ xxxx$ ssh -v -v -v [email protected]
    OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011
    debug1: Reading configuration data /etc/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to [email protected] [188.xxx.237.xx] port 22.
    debug1: connect to address 188.xxx.237.xx port 22: Connection refused
    ssh: connect to host [email protected] port 22: Connection refused

  • ConnectException: Connection refused (No firewall)

    Hi
    In my program i need to connect to another PC on the network. I'm currently trying this tutorial: http://java.sun.com/docs/books/tutorial/networking/sockets/clientServer.html
    The server PC listens to port 4444 without any problem (No error Message "Could not listen on port: 4444" )
    But when the client wants to connect to port 4444, I get this "Connection Refused: connect" error.
    On both PC's the firewall has been disabled, so normally all ports should be open???
    Some standard ports on the server machine (135,139, 445,...) are open, and I can connect to these ports without any problem.
    Anybody has an idea what this problem can be?
    Thanks in advance!

    Hmmm, reboot did the trick :/
    After rebooting, things worked fine. ^^

  • Cannot connect iiop through Firewall(NAT enabled).

    I am using following products.
    - iPlanet Web Server 5.0 [in DMZ]
    - SunONE Application Server 7.0 [in Trust]
    - Firewall(NetScreen)
    =========
    I deploy EJB application to app server and web server.
    But, it don't run collectry. IIOP connection from
    web server to app server is dropped by FW.
    Because web server's web-app try to connect app server
    by using local address(not NATted address).
    Web-app's setting is NATted address.
    Does anyone know answer?

    I uninstalled the
    http://support.microsoft.com/kb/2574819
    and it resumed working for me as well as I had exactly the same issue here.
    there is a point though: removing this KB removes the UDP connection capability of RDP 8.0; arguably the most significant breakthrough the RDP 8 has to offer. shouldn't it be addresses and the problem handled in a better way?
    if RDS Team claim that they've brought all the "adaptive network", "adaptive graphics" , "WAN enhancement" and etc to Windows 7 with the RDP 8 update(see links below), then shouldn't it be as available and as glitch-free as
    it is with a windows 8 VM?
    basically it is unacceptable to force the client to turn off the "automatic determine" feature ; either manually or through the RD-ConnectionBroker tweak of the following link (Jeroen Link):
    http://support.microsoft.com/kb/2863663
    because if it is a supported feature, it has to be supported without IFs and BUTs. this is definitely a bug that needs to be addresses.
    RDP 8 for windows 7 links:
    http://support.microsoft.com/kb/2592687
    http://blogs.msdn.com/b/rds/archive/2012/10/09/remote-desktop-protocol-8-0-update-for-windows-7-sp1-enabling-a-great-wan-user-experience-for-windows-7-sp1-virtual-desktops.aspx
    another thing I noticed : with RDP 8 features enabled, you don't get the event ID 2 as this link suggests anymore:
    http://technet.microsoft.com/en-us/library/ff817587
    maybe you'll get event 34 as this one says. but I am not quite sure:
    http://social.technet.microsoft.com/wiki/contents/articles/16652.remotefx-vgpu-setup-and-configuration-guide-for-windows-server-2012.aspx
    P.S. I am using 2012R2 Hyper-V and it does have this problem as well, so I don't think that compatibility roll up update will help.

  • ITunes will not connect to iTunes store.  Internet is valid and iTunes is allowed through firewall. Help.

    Every time I try to connect to the iTunes store or use the internet in any sort of way through iTunes I recieve an error message that says "network connection refused."  Obviously my internet connection is still working or I wouldn't be on this website, and I've checked both windows firewall, and the McAfee Security programs and there are no blockages in either case.  I'm thinking a recent version on iTunes caused the problem.  Running on Windows Vista Home edition.

    and the McAfee Security programs
    Doublechecking ... do your McAfee products include McAfee Family Protection?
    If so, check to see if your McAfee Family Protection is currently blocking iTunes, as per the following McAfee document:
    Using McAfee Family Protection Web Blocking
    If iTunes is currently being blocked, unblock it.
    Are you able to get through to the Store now?

  • 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.

  • Client connecting through firewall

    Hi
              We have two clustered servers.Our client is connecting through
              firewall NAT. When iam connect to first server the response is very slow and
              at the same time clustering is not working.If i stop the second server the
              response fast .
              The same configaration is working fine when my client is local.
              Can you explain the reason for this problem ?
              Presently iam using weblogic 6.1 version.
              Thank you
              

    OK I spoke too soon. The user looked like it was working but it was working because it matched another IAS policy further down the list. It seems as though the PIX refuses to use ms-chap of any sort. If I include the authentication type in the VPN policy conditions as ms-chap, it skips the VPN policy I am using to authenticate this. If I remove it, then it gives an invalid authentication type as if whatever the PIX is sending the IAS server does not understand as ms-chap.
    It seems like the PIX authentication is totally wrong for use with IAS. What else do I need to add to this configuration to gewt it to work with ms-chap of any kind? I really don't get it.

  • 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.

  • Can RMI get through firewall?

    my java applet will have to communicate with SAP server using JCO
    so the applet connects to an RMI server then the RMI server connects to SAP server.
    in between applet and RMI server there is a firewall. will RMI get through firewall?

    The answer is "maybe". It depends on
    o How the service is coded. Probably has to be written to communicate using a fixed port number, rather than randomly assigned. (Most firewalls allow access to only specified ports.)
    o Changing the firewall settings.
    o Whether or not your server tries to call back the client, and whether the client is also behind a fireall. If these two details are both true, then you are probably dead in the water.
    There are HTTP tunelling techniques for getting through firewalls. Haven't used them, but if you look back through this forum you'll probbly find some info.

  • 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

Maybe you are looking for

  • Phantom hairline showing up in shape, transfers to After Effects, doesn't move on art board

    Hi, First time posting here so hope I'm following protocol. We're having an issue at my office with Illustrator (5.1) and After Effects. This just started happening this week. For some reason, when a file is created in Illustrator and you zoom in ext

  • Send JMS Message to OJMS in a Servlet?

    I'm trying to get my servlet to send a message to a JMS queue hosted by OJMS. I have had the code working with the default JMS provider (in-memory only). I can't fathom what the appropriate JNDI names are for the connection factory and queue when usi

  • [Solved] Disable screen clearing at the end of boot process?

    During the boot process Arch shows some messages on the computer screen while the system services are started. Then it clears the screen just before showing the login prompt, which means that you have to be a really quick reader to be able to catch t

  • ANSI join syntax with code-insight

    I've noticed that SQL Developer 1.1.3 doesn't perform code-insight into table aliases when I use the ANSI join sytax. Is there a configuration option to make this possible or does it just not exist yet?

  • Copy G/L Account

    How can I copy all of G/L accounts from one company code to another company code?