1 Reply Latest reply on May 14, 2004 8:57 AM by Darran Lofthouse

    javax.naming.NameNotFoundException

    srinivas Newbie

      HI I have configured datasource for MS sql server 2000 and copied mssql-ds.xml in deploy folder.after the server starts when i look up for jndi name it gives namenotfound exception.

      mssql-ds.xml


      <local-tx-datasource>
      <jndi-name>MSSQLDS</jndi-name>
      <connection-url>jdbc:microsoft:sqlserver://142.176.225.133:1433;DatabaseName=Centrum</connection-url>
      <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
      <user-name>sa</user-name>
      admin
      <!-- sql to call when connection is created
      <new-connection-sql>some arbitary sql</new-connection-sql> -->


      <!-- sql to call on an existing pooled connection when it is obtained from pool
      <check-valid-connection-sql>some arbitary sql</check-valid-connection-sql>-->

      </local-tx-datasource>



      Client code
      ---------------

      Properties env=new Properties();

      env.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
      env.setProperty("java.naming.provider.url","localhost:1099");
      env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming");

      Context ctx=new InitialContext(env);
      Object obj =ctx.lookup("java:/MSSQLDS");

      Thanks for ur reply