JBoss Community

javax.naming.NameNotFoundException: DefaultDS not bound

created by pippodev in Beginner's Corner - View the full discussion

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");

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community