How do I deploy my resource adapter?
Take your standard rar deployment (either as a standalone deployment or part of another deployment like an ear) and place it in deploy. You then need a -ds.xml file, examples can be found in docs/examples/jca or the jms resource adapater deployment deploy/jms/jms-ds.xml
The -ds.xml is what actually deploys the ConnectionFactory from the rar deployment,
configuring the pool, jndi name and other parameters.
It is the equivalent of sun-ra.xml or weblogic-ra.xml.
The file can either be deployed in the deploy directory or placed in the root of the rar
file (not recommended because it is harder to change the configuration).
The rar acts as a template for the connection factory deployment in the ds.xml
It is important for non-jdbc deployments that the adapter-display-name matches the display-name from the ra.xml inside the rar
The full detail of what goes in the -ds.xml can be found in docs/dtd/jboss-ds_1_0.dtd or the admin docs.
NOTE: If you are deploying a datasource, you will also need to put the jdbc driver in server/default/lib
Changes in JBoss4
From JBoss-4.0.0DR4 the adapter-display-name is no longer used, instead
the rar-name and connection definition are used.
This is because JCA 1.5 can have multiple connection factories (connection definitions)
whereas JCA1.0 had only one.
Also, the opportunity was taken to simplyify the deployment of rars inside ears.
Uses the adapter-display-name which matches the display-name from the rar
<tx-connection-factory> ... <adapter-display-name>JMS Adapter</adapter-display-name> </tx-connection-factory> ...
Uses rar-name and connection-definition in its 1.0 and 1.5 -ds.xml where each is defined below:
rar-name is the actual RAR file name, not a logical name like the previous adapter-display-name.
connection-definition is the ConnectionFactory interface defined in the ra.xml, NOT ConnectionFactory implementation class.
Note: The jboss-ds_1_0.dtd does not have these elements listed, but they are required to deploy a JCA 1.0 connector in JBoss 4! Remove the DTD reference at the top of your -ds.xml descriptor if you cannot modify it without validation errors because these elements don't exist.
<tx-connection-factory> ... <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> ... </tx-connection-factory>
Example of a rar inside an ear:
<tx-connection-factory> ... <rar-name>myapplication.ear#jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> ... </tx-connection-factory>