2 Replies Latest reply on Sep 7, 2010 11:38 AM by Noelia Delgado

    javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.10.136:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out

    Noelia Delgado Newbie

      Hi,

      I am running JBoss 5.1.0.GA and it appears I am unable to establish a connection from a client running remotely.

      When I run the client locally and connect using 'localhost:1099' or '127.0.0.1:1099' the connection succeeds, but when I provide the computer's ip

      '192.168.10.136:1099' I get the printStackTrace() output below:

       

      g28:/home/noelia/Desktop# java -jar AppClient.jar

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.10.136:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /192.168.10.136:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]]]

      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

      at javax.naming.InitialContext.lookup(InitialContext.java:392)

      at util.Contexto.getInterfazRemota(Contexto.java:29)

      at mesa_entrada.IdPaciente.getInterfazRemota(IdPaciente.java:1635)

      at mesa_entrada.IdPaciente.setInterfazRemotaPaciente(IdPaciente.java:1645)

      at mesa_entrada.IdPaciente$8.actionPerformed(IdPaciente.java:1031)

      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

      at java.awt.Component.processMouseEvent(Component.java:6216)

      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

      at java.awt.Component.processEvent(Component.java:5981)

      at java.awt.Container.processEvent(Container.java:2041)

      at java.awt.Component.dispatchEventImpl(Component.java:4583)

      at java.awt.Container.dispatchEventImpl(Container.java:2099)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)

      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)

      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)

      at java.awt.Container.dispatchEventImpl(Container.java:2085)

      at java.awt.Window.dispatchEventImpl(Window.java:2475)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Caused by: javax.naming.CommunicationException: Failed to connect to server /192.168.10.136:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]]

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)

      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)

      ... 32 more

      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)

      ... 33 more

      Caused by: java.net.ConnectException: Conexión rehusada

      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:519)

      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)

      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)

      ... 33 more

      java.lang.NullPointerException

      at mesa_entrada.IdPaciente$8.actionPerformed(IdPaciente.java:1043)

      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

      at java.awt.Component.processMouseEvent(Component.java:6216)

      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

      at java.awt.Component.processEvent(Component.java:5981)

      at java.awt.Container.processEvent(Container.java:2041)

      at java.awt.Component.dispatchEventImpl(Component.java:4583)

      at java.awt.Container.dispatchEventImpl(Container.java:2099)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)

      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)

      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)

      at java.awt.Container.dispatchEventImpl(Container.java:2085)

      at java.awt.Window.dispatchEventImpl(Window.java:2475)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      g28:/home/noelia/Desktop# java -jar AppClient.jar

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.10.136:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /192.168.10.136:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]]]

      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1763)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:693)

      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

      at javax.naming.InitialContext.lookup(InitialContext.java:392)

      at util.Contexto.getInterfazRemota(Contexto.java:29)

      at mesa_entrada.IdPaciente.getInterfazRemota(IdPaciente.java:1635)

      at mesa_entrada.IdPaciente.setInterfazRemotaPaciente(IdPaciente.java:1645)

      at mesa_entrada.IdPaciente$8.actionPerformed(IdPaciente.java:1031)

      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

      at java.awt.Component.processMouseEvent(Component.java:6216)

      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

      at java.awt.Component.processEvent(Component.java:5981)

      at java.awt.Container.processEvent(Container.java:2041)

      at java.awt.Component.dispatchEventImpl(Component.java:4583)

      at java.awt.Container.dispatchEventImpl(Container.java:2099)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)

      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)

      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)

      at java.awt.Container.dispatchEventImpl(Container.java:2085)

      at java.awt.Window.dispatchEventImpl(Window.java:2475)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      Caused by: javax.naming.CommunicationException: Failed to connect to server /192.168.10.136:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]]

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:335)

      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1734)

      ... 32 more

      Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server /192.168.10.136:1099 [Root exception is java.net.ConnectException: Conexión rehusada]

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:305)

      ... 33 more

      Caused by: java.net.ConnectException: Conexión rehusada

      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:519)

      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:97)

      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:82)

      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:301)

      ... 33 more

      java.lang.NullPointerException

      at mesa_entrada.IdPaciente$8.actionPerformed(IdPaciente.java:1039)

      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)

      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)

      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)

      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)

      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)

      at java.awt.Component.processMouseEvent(Component.java:6216)

      at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

      at java.awt.Component.processEvent(Component.java:5981)

      at java.awt.Container.processEvent(Container.java:2041)

      at java.awt.Component.dispatchEventImpl(Component.java:4583)

      at java.awt.Container.dispatchEventImpl(Container.java:2099)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)

      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)

      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)

      at java.awt.Container.dispatchEventImpl(Container.java:2085)

      at java.awt.Window.dispatchEventImpl(Window.java:2475)

      at java.awt.Component.dispatchEvent(Component.java:4413)

      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)

      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)

      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

        

      My client code is:

        

      public

       

      Contexto()throws NamingException{

      Properties env =

      new Properties();

       

      // Try with a login that should succeed

      env.setProperty(

      "java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");

      env.setProperty(Context.

      URL_PKG_PREFIXES, "org.jboss.naming.client");

      env.setProperty(Context.

      PROVIDER_URL, "jnp://192.168.10.136:1099");

      env.setProperty(Context.

      SECURITY_CREDENTIALS, "");

      env.setProperty(Context.

      SECURITY_PRINCIPAL, "");

      env.setProperty(Context.

      SECURITY_PROTOCOL, "java:/jaas/App");

       

      this.ctx = new InitialContext(env);

      }

        

      if anyone can help me I would appreciate.

        

      thanks

      Noelia