JBoss.org Community Documentation

B.7.2. The More Flexible Way

Changing the external datasource to DefaultDS is convenient. But if you have applications that assume the DefaultDS always points to the factory-default HSQL DB, that approach could break your application. Also, changing DefaultDS destination forces all JBoss services to use the external database. What if you want to use the external database only on some services?

A safer and more flexible way to hook up JBoss AS services with the external datasource is to manually change the DefaultDS in all standard JBoss services to the datasource JNDI name defined in your *-ds.xml file (e.g., the MySqlDS in mysql-ds.xml etc.). Below is a complete list of files that contain DefaultDS. You can update them all to use the external database on all JBoss services or update some of them to use different combination of datasources for different services.

  • jboss-as/server/production/conf/login-config.xml: This file is used in Java EE container managed security services.

  • jboss-as/server/production/conf/standardjbosscmp-jdbc.xml: This file configures the CMP beans in the EJB container.

  • jboss-as/server/production/deploy/ejb-deployer.xml: This file configures the JBoss EJB deployer.

  • jboss-as/server/production/deploy/schedule-manager-service.xml: This file configures the EJB timer services.

  • jboss-as/server/production/deploy/snmp-adaptor.sar/attributes.xml: This file is used by the SNMP service.

  • jboss-as/server/production/deploy/juddi-service.sar/META-INF/jboss-service.xml: This file configures the UUDI service.

  • jboss-as/server/production/deploy/juddi-service.sar/juddi.war/WEB-INF/jboss-web.xml: This file configures the UUDI service.

  • jboss-as/server/production/deploy/juddi-service.sar/juddi.war/WEB-INF/juddi.properties: This file configures the UUDI service.

  • jboss-as/server/production/deploy/uuid-key-generator.sar/META-INF/jboss-service.xml: This file configures the UUDI service.

  • jboss-as/server/production/jms/hsqldb-jdbc-state-service.xml and jboss-as/server/all/deploy-hasingleton/jms/hsqldb-jdbc-state-service.xml: Those files configure the JMS persistence service as we discussed earlier.