3 Replies Latest reply on Jul 22, 2002 3:04 PM by asharzaman

    Using an XA Connection Pool

    piazza

      I am trying to access the connection I configured in JBoss. When JBoss is launched, I can see that the connection pool is started by the following message:

      [INFO,SQLServerPool] Starting
      [INFO,SQLServerPool] XA Connection pool SQLServerPool bound to java:/SQLServerPool
      [INFO,SQLServerPool] Started

      When I launch my client app, I get the following stack trace:

      javax.naming.NameNotFoundException: No object bound for java:/SQLServerPool
      at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)

      My code to access the connection pool is as follows:

      Properties props = System.getProperties();
      props.setProperty( "java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
      props.setProperty( "java.naming.factory.url.pkgs", "org.jboss.naming" );
      props.setProperty( "java.naming.provider.url", "localhost:1099" );
      Context ctx = new InitialContext( props );
      DataSource ds = (DataSource)ctx.lookup("java:/SQLServerPool");

      Any ideas as to why I am having this problem? Thanks in advance for your help.

      Tony Piazza