7 Replies Latest reply on Nov 18, 2015 11:48 AM by teknopaul

    java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;

    kobiianko

      Hi,

      when I try to access a remote JBoss5.1 server on a diffrent subnet by using the server IP I'm getting:(on the client side)

       

      Caused by: java.rmi.UnknownHostException: Unknown host: linx50intg.abc.local; nested exception is:
          java.net.UnknownHostException: linx50intg.abc.local
          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.invoke(Unknown Source)
          at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
          ... 30 more

       

      If I'll add this server name (linx50intg.abc.local) to the client HOSTS file it will work, but this is not acceptable by the costumers (to make changes to all clients).

       

      is the a way to config JBoss to work only with the IP address?

       

      on JBoss4.0.5 the communication is on the IP address and everything is working.

       

      I'm working with windows client and redhat5 server

        • 1. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
          jaikiran

          When exactly does that error occur? And is that the complete stacktrace? If not, please post the complete stacktrace and any relevant code which triggers this error.

          • 2. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
            kobiianko

            this occur at the first look up, from the client,

            using wireshark sniffer I can see that the reply from the server is to connect via hostname, did the same on jboss4.0.5 and in the packet I can see that the reply from the server is to connect via IP and everything is working.

             

            also client connection params are:

             

            java.naming.factory.initial     org.jnp.interfaces.NamingContextFactory

            java.naming.provider.url     jnp://"+ipAddress+":1099

            java.naming.factory.url.pkgs     org.jboss.naming:org.jnp.interfaces

             

            Full Stacktrace:

             

            2010-05-24 14:00:30 [javawsApplicationMain] ERROR login.module.AppLoginModule  - Error attempting to authenticate user
            com.allot.nms.admin.exception.AdminException
                at com.allot.nms.admin.client.AdminHelper.findAuthenticatedUser(AdminHelper.java:95)
                at com.allot.nms.client.ui.frm.login.module.AppLoginModule.authenticateUser(AppLoginModule.java:184)
                at com.allot.nms.client.ui.frm.login.module.AppLoginModule.login(AppLoginModule.java:144)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at javax.security.auth.login.LoginContext.invoke(Unknown Source)
                at javax.security.auth.login.LoginContext.access$000(Unknown Source)
                at javax.security.auth.login.LoginContext$4.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
                at javax.security.auth.login.LoginContext.login(Unknown Source)
                at com.allot.nms.client.ui.frm.login.AppLogin.attemptThreeLogins(AppLogin.java:78)
                at com.allot.nms.client.ui.frm.login.AppLogin.doAppLogin(AppLogin.java:38)
                at com.allot.nms.client.ui.frm.Controller.loginUser(Controller.java:176)
                at com.allot.nms.client.ui.frm.Controller.initGUI(Controller.java:261)
                at com.allot.nms.client.ui.main.AllotNMS.main(AllotNMS.java:60)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at com.sun.javaws.Launcher.executeApplication(Unknown Source)
                at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
                at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
                at com.sun.javaws.Launcher.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
            Caused by: com.allot.nms.common.util.ServiceLocatorException: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local]
                at com.allot.nms.common.util.ServiceLocator.getRemoteHome(ServiceLocator.java:121)
                at com.allot.nms.admin.client.AdminHelper.findAuthenticatedUser(AdminHelper.java:88)
                ... 26 more
            Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local]
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                at javax.naming.InitialContext.lookup(Unknown Source)
                at com.allot.nms.common.util.ServiceLocator.getRemoteHome(ServiceLocator.java:115)
                ... 27 more
            Caused by: java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local
                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.invoke(Unknown Source)
                at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
                ... 30 more
            Caused by: java.net.UnknownHostException: linx50intg.allot.local
                at java.net.PlainSocketImpl.connect(Unknown Source)
                at java.net.SocksSocketImpl.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)
                ... 36 more
            com.allot.nms.admin.exception.AdminException
                at com.allot.nms.admin.client.AdminHelper.findAuthenticatedUser(AdminHelper.java:95)
                at com.allot.nms.client.ui.frm.login.module.AppLoginModule.authenticateUser(AppLoginModule.java:184)
                at com.allot.nms.client.ui.frm.login.module.AppLoginModule.login(AppLoginModule.java:144)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at javax.security.auth.login.LoginContext.invoke(Unknown Source)
                at javax.security.auth.login.LoginContext.access$000(Unknown Source)
                at javax.security.auth.login.LoginContext$4.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
                at javax.security.auth.login.LoginContext.login(Unknown Source)
                at com.allot.nms.client.ui.frm.login.AppLogin.attemptThreeLogins(AppLogin.java:78)
                at com.allot.nms.client.ui.frm.login.AppLogin.doAppLogin(AppLogin.java:38)
                at com.allot.nms.client.ui.frm.Controller.loginUser(Controller.java:176)
                at com.allot.nms.client.ui.frm.Controller.initGUI(Controller.java:261)
                at com.allot.nms.client.ui.main.AllotNMS.main(AllotNMS.java:60)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at com.sun.javaws.Launcher.executeApplication(Unknown Source)
                at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
                at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
                at com.sun.javaws.Launcher.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
            Caused by: com.allot.nms.common.util.ServiceLocatorException: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local]
                at com.allot.nms.common.util.ServiceLocator.getRemoteHome(ServiceLocator.java:121)
                at com.allot.nms.admin.client.AdminHelper.findAuthenticatedUser(AdminHelper.java:88)
                ... 26 more
            Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local]
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:839)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
                at javax.naming.InitialContext.lookup(Unknown Source)
                at com.allot.nms.common.util.ServiceLocator.getRemoteHome(ServiceLocator.java:115)
                ... 27 more
            Caused by: java.rmi.UnknownHostException: Unknown host: linx50intg.allot.local; nested exception is:
                java.net.UnknownHostException: linx50intg.allot.local
                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.invoke(Unknown Source)
                at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
                ... 30 more
            Caused by: java.net.UnknownHostException: linx50intg.allot.local
                at java.net.PlainSocketImpl.connect(Unknown Source)
                at java.net.SocksSocketImpl.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)
                ... 36 more

            • 3. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
              kobiianko

              does anyone have any suggestion?

              • 4. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
                kobiianko

                found this:  https://jira.jboss.org/browse/EJBTHREE-1935

                 

                can any of you masters help me fix this code... I'm sure that with some little guidance I can fix it.

                 

                10x

                Kobi

                • 5. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
                  kobiianko

                  OK, found a possible solution to this,

                  You can add -Djava.rmi.server.hostname=<ip> -Dremoting.bind_by_host=false to the run script at the server

                  It works!!!

                   

                  This forces you to hard code the IP of your sever and make sure it does not change over time.

                  • 6. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
                    jaikiran

                    Good to know that you got it working. And thanks for posting the solution here.

                    • 7. Re: java.rmi.UnknownHostException: Unknown host: linx50intg.X.local;
                      teknopaul

                      What if you want to call more than one remote server?