4 Replies Latest reply on Apr 24, 2006 10:01 AM by Price Ellington

    JNDI Lookup timeout

    Price Ellington Newbie


      I am trying to get a connection to a datasource but I am getting a communication exception. I'm not sure what the problem is here and I haven't seen any other posts with the same issue. Can someone please point me in the right direction? The exception I get doing a lookup for the datasource is:

      javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

      We are using MS Sql Server, here is the mssql-ds.xml file:


      And here is the code to lookup the datasource:

      Connection con = null;
      Context ctx = null;
      Hashtable env = new Hashtable();
      env.put(Context.SECURITY_PRINCIPAL, "XXX");
      env.put(Context.SECURITY_CREDENTIALS, "XXX");

      ctx = new InitialContext(env);
      javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("jndiname");
      con = ds.getConnection();
      }catch(Exception e) {

      Thanks in advance.