3 Replies Latest reply on Feb 16, 2011 2:55 AM by Nicklas Karlsson

    javax.naming.NameNotFoundException: DefaultDS not bound

    pippodev Newbie

      well I put mysql-connector-java-5.1.14-bin.jar in default/lib  dir,

      created mysql-ds.xml in defautl/deploy

       

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
      
      
                <local-tx-datasource>
                          <jndi-name>DefaultDS</jndi-name>
                          <connection-url>jdbc:mysql://localhost:3306/prova</connection-url>
                          <driver-class>com.mysql.jdbc.Driver</driver-class>
                          <user-name>root</user-name>
                          <password>root</password>
                          <!-- should only be used on drivers after 3.22.1 with "ping" support
          <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
          --> 
      
                          <metadata>
                                              <type-mapping>mySQL</type-mapping>
                          </metadata>
                </local-tx-datasource>
      </datasources>
      
      

       

      but I have the error  javax.naming.NameNotFoundException: DefaultDS not bound

      both I use

       

       

      ds = (DataSource)  PortableRemoteObject.narrow(ictx.lookup("java:DefaultDS"), DataSource.class);
      

       

      or

       

       

      ds = (DataSource)ictx.lookup("DefaultDS");