3 Replies Latest reply on Jun 19, 2007 4:15 AM by zolv

    DataSource to MySQL with Axis2 and JBoss

    zolv

      Using: JBoss v4.0, Axis2 v1.2, OS: FreeBSD, MySQL 5.0.27

      I have problem with setting DataSource using JBoss.

      I have created mysql-ds.xml and put it into deploy dir:

      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>jdbc/dw</jndi-name>
      <connection-url>jdbc:mysql://myserver:3306/db</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>user</user-name>
      password
      </local-tx-datasource>


      During starting up JBoss there is info:

      ...
      2007-06-14 14:10:41,649 INFO [org.jboss.resource.connectionmanager.ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/dw' to JNDI name 'java:jdbc/dw'
      ...

      so it looks ok.

      Previously I was working with Tomcat and there was no prefix "java:" before datasource name and I'm little suprise that it appears here. It looks like DS name is java:jdbc/dw instead of just jdbc/dw

      in Axis2 context.xml file I have put:

      ...
      <ResourceLink name="jdbc/dw global="java:jdbc/dw" type="javax.sql.DataSource" />
      ...

      but I get error:
      Couldn't find data source:java:jdbc/dw

      I am confused, because I have found several tutorials how to set datasources in JBoss and there are placed different infos (only creating *-ds.xml file is common)

      What am I doing wrong or missing something?

      Greetings
      zolv

        • 1. Re: DataSource to MySQL with Axis2 and JBoss
          zolv

           

          "zolv" wrote:

          <?xml version="1.0" encoding="UTF-8"?>
          <datasources>
          <local-tx-datasource>
          <jndi-name>jdbc/dw</jndi-name>
          <connection-url>jdbc:mysql://myserver:3306/db</connection-url>
          <driver-class>com.mysql.jdbc.Driver</driver-class>
          <user-name>user</user-name>
          <password>password</password>
          </local-tx-datasource>
          </datasources>


          Forum-software erased <password_> and </password_> tags around password (without underscores), of course it must be there

          zolv

          • 2. Re: DataSource to MySQL with Axis2 and JBoss
            ciaciapek

            I am not sure if that will solve Your problem but since you are trying to access the datasource configured inside JBoss from bundled Tomcat context You have to configure datasource as:

            <use-java-context>false</use-java-context>

            so if You haven't yet added this line to your mysql-ds.xml file, do so and give it a shot.

            i hope it helps

            b.r.
            ciapek

            • 3. Re: DataSource to MySQL with Axis2 and JBoss
              zolv

               

              "ciaciapek" wrote:
              ...
              <use-java-context>false</use-java-context>
              ...


              Thx, It works!

              zolv