5 Replies Latest reply on Dec 8, 2004 7:40 AM by Pieter Pareit

    CMP with mySql

    Pieter Pareit Newbie


      I still have problems let my CMP bean, interact with mySQL. My bean still saves the data into the HyperSonic DB. My mysql-ds.xml is configured right, because when startup jboss4.0, there are two tables (jms_messages, jms_transactions) automat created into my mySql db.

      I also added the mysql-jdbc2-service.xml file into the deploy\jms directory and removed the hsqldb-jdbc2-service.xml from the deploy\jms directory.

      Below my three xml files, that I save in the META-INF of my bean jar.

      1) jbosscmp-jdbc.xml
      ------------------------------------------------------------------------------- -----------------
      <?xml version="1.0" encoding="UTF-8"?>






      2) jboss.xml
      ------------------------------------------------------------------------------- -----------------
      <?xml version="1.0"?>




      3) ejb-jar.xml
      ------------------------------------------------------------------------------- -----------------
      <?xml version="1.0"?>




      Encapsulates a User
      hotline.beheerhotline.basisbestanden.initialen.InitialenRemote< /remote>







      Last my mysql-ds.xml
      <?xml version="1.0" encoding="UTF-8"?>

      <connection-url>jdbc:mysql://localhost:3306/hotline</connection-url> ;


      It would be grate if somebody knows where I'm wrong.

      Thx in adv,

        • 1. Re: CMP with mySql
          Darran Lofthouse Master

          Are you sure that both of the deployment descriptors are in the META-INF of your jar?

          Also the -ds.xml goes in the deploy folder of your selected JBoss configuration not in the META-INF of the component.

          • 2. Re: CMP with mySql
            Pieter Pareit Newbie

            Yes yes, I'm sure

            my jar consists of:

            + hotline
            |-+ beheerhotline
            |--+ basisbestanden
            |---+ initialen
            |----- InitialenHomeRemote
            |----- InitialenRemote
            |----- InitialenBean
            + META-INF
            |- ejb-jar.xml
            |- jboss.xml
            |- jbosscmp-jdbc.xml

            I putted the jar in my deploy dir together with the mysql-ds.xml


            • 3. Re: CMP with mySql
              Joan Horta  Tosas Novice

              Did you remove the hsqldb-ds.xml file from the deploy dir and copied the MySQL JDBC drivers into the server/{yourconfig}/lib dir?

              • 4. Re: CMP with mySql
                Darran Lofthouse Master

                The hsqldb-ds.xml shouldn't need to be removed from the deploy directory, it is possible to run with both in parallel.

                Also as the two JMS tables are being created the driver must have been found so that the connection can be established.

                Unless JBoss is ignoring the jbosscmp-jdbc.xml file it looks to me as if there may be a slight packaging error that is causing the file to be missed.

                • 5. Re: CMP with mySql
                  Pieter Pareit Newbie

                  darranl, you're right my jboss ignores my jbosscmp-jdbc.xml file. I know because when I add wrong XML syntacs, my jboss doesn't complain.

                  darranl is't it possible to send me a working CMP bean that uses MySql, it would help me a lot. Then I can be sure I'm using the right structure.

                  email is Pieter at ChatBuilder.com

                  Thx in adv.