0 Replies Latest reply on Mar 12, 2009 10:58 AM by Simon Desbonnets

    Tutorial: how to change the JBossESB database (update of the

    Simon Desbonnets Newbie

      This is an update of the documentation http://www.jboss.org/jbossesb/docs/4.4.GA/manuals/pdf/AdministrationGuide.pdf. I wrote here additional requirements and some useful (I hope) information but thanks a lot to the original writer for the main information of this tutorial.

      Default configuration of JbossESB is using hsql database. The goal of this small tutorial is to migrate to MySQL.

      Versions used:
      - JBossESB 4.5 GA
      - MySQL 5.0.51a


      1. Copy the file 'mysql-ds.xml' from docs/examples/jca/ to server/default/deploy/
      - You can change the jndi name:

      <jndi-name>DefaultDS</jndi-name>

      - Update the 'connection-url' with your own settings, for example:
      <connection-url>jdbc:mysql://localhost:3306/jbossdb</connection-url>

      -Finally put your own login and password.

      2. If you have changed the 'jndi-name' to "DefaultDS", you have to remove the server/default/deploy/hsqldb-ds.xml file (which jndi-name is also "DefaultDS").

      3. Replace deploy/jbossesb.sar/juddi-ds.xml with the same configuration in the previous step (change the database name if needed) except the 'jndi-name' (keep the value juddiDB).

      4. Replace deploy/jbossesb.esb/message-store-ds.xml with the same configuration in step one (change the database name if needed). Again make sure to keep the jndi-name (JBossESBDS).

      5. Replace in deploy/jbossesb.esb/jbossesb-service.xml (Caution, this field is case sensitive):

      <attribute name="SqlFiles">
      messagestoresql/hsqldb/create_database.sql
      </attribute>

      By:
      <attribute name="SqlFiles">messagestoresql/mysql/create_database.sql</attribute>


      6. Replace in deploy/jbossesb.sar/esb.uddi.xml (Caution, this field is case sensitive):

      <entry key="juddi.sqlFiles">
      juddisql/hsqldb/create_database.sql,juddisql/hsqldb/import.sql
      </entry>

      By:
      <entry key="juddi.sqlFiles">juddisql/mysql/create_database.sql,juddisql/mysql/import.sql</entry>



      7. Add the file deploy/jboss-messaging.sar/mysql-persistence-service.xml. You can found it in the JBM project. By default, this file is not include in JbossESB, you may have to download Jboss Messaging (http://www.jboss.org/jbossmessaging)
      This needs to match the same version and might not work it the versions mismatch (check the version with deploy\jboss-messaging.sar\META-INF\MANIFEST.MF).
      These files can be found in src/etc/server/default/deploy of a JBM distribution.

      Important: by default, the attribute 'clustered' has the value 'true'. If you don't use clustering turn it to 'false'.

      8. Download the MysQL driver (http://dev.mysql.com/downloads/connector/j/5.1.html) and paste it in the server/default/lib folder.

      9. Finally, create the empty databases:
      DROP DATABASE IF EXISTS `jbossdb`;
      CREATE DATABASE `jbossdb` ;
      
      DROP DATABASE IF EXISTS `juddiDB`;
      CREATE DATABASE `juddiDB` ;
      
      DROP DATABASE IF EXISTS `jbossesb`;
      CREATE DATABASE `jbossesb` ;


      (Sorry for my english but if you prefer the french version... :-)