Migrate JBoss Datasources howto

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

This tutorial shows how you can automatically convert your Datasources from earlier JBoss AS versions (4-5-6) to JBoss AS 7 modular configuration using IronJacamar migration tool.

As most of you probably know, in previous versions of the application server, datasources and resource adapters were configured and deployed using a file with a suffix of *-ds.xml.

The IronJacamar 1.1.0 distribution contains a migration tool that can be used to convert these configuration files into the format expected by JBoss AS 7. The tool parses the source configuration file from the previous release, then creates and writes the XML configuration to an output file in the new format. The resulting XML can then be copied and pasted under the correct subsystem of JBoss AS 7 configuration file.

Download the IronJacamar 1.1 distribution from http://www.jboss.org/ironjacamar

Example: mysql-ds.xml (JBoss 4/5/6 Datasource for MySQL database)

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


Now move to the doc\as folder of your ironjacamar-1.1.0 distribution and issue the following command:

C:\ironjacamar-1.1.0.Alpha7\doc\as>converter.bat -ds mysql-ds.xml mysql-as7.xml

As you can see the converter batch file (converter.sh for Unix OS) accepts as parameter -ds to choose between resource adapter and datasource and then the INPUT xml file and the OUTPUT file.

Here's the generated mysql-as7.xml file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  <datasource enabled="true" jndi-name="java:jboss/datasources/MySqlDS" jta="true" pool-name="MySqlDS" use-ccm="true" use-java-context="true">
      <exception-sorter class-name="org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter"/>

As you can see the file has been enriched with some defaults for <pool> and <validation>, <timeout> and <statement> so that you further configure your Datasource in AS 7. One more important note is that this tool automatically converts the JNDI name binding to meet AS 7 standards (java:jboss/datasources/MySqlDS).


Related articles available on mastertheboss.com

How to deploy a DataSource in jboss at application level ?

  Do you need to deploy your DataSource along with your Enterpri

JBoss Datasource HA

This tutorial has been updated for the new release of JBoss Appli

JBoss run out of Connections ?

Have you got No ManagedConnections available error message ? well

How to connect to a DataSource from a remote client?

  If you want to connect to your JBoss Connection Pool from a re

JBoss Datasource configuration

A Datasource is a Java Naming and Directory Interface (JNDI) obje

How do I get the list of Datasources available ?

JBOSS AS 4/5 Users You can use either twiddle: $ twiddle.sh que