3 Replies Latest reply on Aug 19, 2004 2:49 PM by noseya

    JBoss Connection Pooling - MySqlDS not bound Error

      Hi:

      I am new to JBoss and am trying to get a connection pool to work with MySql. The steps I followed were:

      1. I copied the mysql-ds.xml from the examples and placed it into the deploy directory.

      2. I modified the xml to do the following with a user of root with no password (tried it with other users and passwords get the same error):


      <local-tx-datasource>
      <jndi-name>MySqlDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/tms</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>root</user-name>

      </local-tx-datasource>


      3. Created a test JSP page with the following code (compiles fine):

      <%
      DataSource datasource;
      out.print("Trying lookup");
      try
      {
      InitialContext initialContext = new InitialContext();
      datasource = (DataSource) initialContext.lookup("MySqlDS");
      if (datasource == null) {
      // JNDI API is ambigious as to whether this is necessary.
      out.print("DataSrouce is null");
      }
      }
      catch (Exception ne) {
      out.print("" + ne);
      }
      %>

      4. Get the following error:

      javax.naming.NameNotFoundException: MySqlDS not bound

      Can anyone help me understand what I did wrong?

      Thanks,

      John