JBoss XA datasources and mbean error

When deploying an application on Jboss that used Oracle and XA datasources, the following error croped up:

org.jboss.deployment.DeploymentException: Trying to install an already registered mbean: jboss.jca:service=OracleXAExceptionFormatter

It took me a while to found out what the issue was, and the lead to the solution was that the error moved from datasource to datasource according to it’s name, namely the xml definition filename.

The issue is quite simple: XA datasources can only have one mbean definition for the OracleXAExceptionFormatter, so choose one, and only one and put the required definition:

<mbean code=”org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter”
name=”jboss.jca:service=OracleXAExceptionFormatter”>
<depends optional-attribute-name=”TransactionManagerService”>jboss:service=TransactionManager</depends>
</mbean>

Remove this definition from any other XA datasource and the error should disappear and all datasources can bound now without any errors.

Advertisements