1 Reply Latest reply on Aug 6, 2004 11:05 AM by Nicholas Whitehead

    how to make swing program on client machine to connect to ej

    Chong Liang Newbie

      We are ready to go to production and having several issues :
      1. We have a swing application accessing the EJB's. In order to make an external deployment of the swing client I have copied the following jar files to the client side: jboss_all, jboss_client, j2eeserver, jbos_common_client, jboss_j2ee, jnet, jnp_client, jsse, log4j, AbsoluteLayout. Nevertheless, I still get a client timeout error as below.
      2. We have coded jndi properties as follows:

      //Initial Context
      private InitialContext getInitialContext() throws NamingException {
      if (initialContext == null) {

      Hashtable environment = new Hashtable();
      (Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      initialContext = new InitialContext(environment);


      return initialContext;


      javax.naming.CommunicationException: Receive timed out [Root exception is
      java.net.SocketTimeoutException: Receive timed out]
      at org.jnp.interfaces.NamingContext.discoverServer
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1127)
      at org.jnp.interfaces.NamingContext.list(NamingContext.java:676)
      at org.jnp.interfaces.NamingContext.list(NamingContext.java:669)
      at javax.naming.InitialContext.list(InitialContext.java:387)
      at Prueba1.main(Prueba1.java:78) Caused by: java.net.SocketTimeoutException: Receive timed out
      at java.net.PlainDatagramSocketImpl.receive(Native Method)
      at java.net.DatagramSocket.receive(DatagramSocket.java:711)
      at org.jnp.interfaces.NamingContext.discoverServer
      ... 5 more

      the same code, running in the same machine as the application server, that is, in development phase, works fine. We double check the host ip address and port and it’s working. The problem, we think, has to do with the deployment of the swing client independently from the app server. Everything is proper and running until we try to go to production mode and then the jndi lookups doesn’t work anymore.

      Any ideas????

        • 1. Re: how to make swing program on client machine to connect t
          Nicholas Whitehead Novice

          We ran into some similar issues.
          Check the following:

          Your production environment may have some firewall or routing issues. Up the verbosity of your jboss server and see if it is showing any activity when your clients try to connect. It sounds to me like the client cannot reach the server. Perhaps you could even create and run a super stripped down and simple JNDI test client.
          Sometimes, production servers are multi-homed. Make sure that the is the first bound (default ) NIC, or set the binding address on the startup using the run.bat -b option.

          Good luck.