3 Replies Latest reply on Jan 27, 2004 3:49 PM by Normand Martel

    MySql Datasource Configuration

    carlos.gurgel Newbie


      "carlos.gurgel" wrote:
      I wanna know how files are involved in the process of create a MySQL Datasource in JBoss 3.2.
      I have been trying many solutions of various tutorials but doesn't work.

      I tryed create just the mysql-ds.xml file like this:


      , edit the standardjaws.xml:


      and the standardjbosscmp-jdbc.xml:


      Everything seems that will going fine:

      22:08:51,117 INFO [MySqlDs] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=MySqlDs to JNDI name 'java:/MySqlDs'
      22:08:51,127 INFO [TxConnectionManager] Started jboss.jca:service=LocalTxCM,name=MySqlDs

      But when i deploy my app-ejb.jar, i get this error:

      22:08:56,174 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping MySqlDs not found

      Any ideas?


        • 1. Re: MySql Datasource Configuration
          Normand Martel Newbie

          Try changing you container managed persistance bean like this:



          <row-locking-template>SELECT ?1 FROM ?2 WHERE ?3 FOR UPDATE</row-locking-template>
          <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
          <fk-constraint-template>ALTER TABLE ?1 ADD INDEX ind_?2 (?3), ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
          <auto-increment-template>?1 auto_increment</auto-increment-template>

          The data source is specified first... this is where your camel-case name goes.

          The db mapping types come next. The second arg needs to be "mySQL" to match the translations or mappings portion. Make sure that you have the "mySQL" mappings further down in the CMP configuration file.

          • 2. Re: MySql Datasource Configuration
            Normand Martel Newbie

            Marc F... fix this posting code.... it keeps mangling the posts!



            The first portion of my prior post should look like the above.

            • 3. Re: MySql Datasource Configuration
              Normand Martel Newbie

              Sorry the posts aren't working right!

              Talk to the JBoss folks.

              The less than/greater than appear to cause problems to the parsing/posting code.

              Also, the web master ignores any email you send.
              Last gripe... no webmaster contact on the web site!!!