-
Enhancement
-
Resolution: Done
-
Major
-
3.2.0.Final
-
None
(See https://github.com/ModeShape/modeshape/pull/812 for the original problem.)
The JCA adapter (and the RAR) is not correct according to the JEE 1.5 specification, and cannot be deployed on a JBoss 5 EAP server.
The ra.xml must be changed to have valid class names, and the configuration is done on the ManagedConnectionFactory instead of the Resource Adapter. This should in theory allow to deploy multiple modeshape repositories with multiple configuration files, but I didn't test this. The test case was also modified because the configuration is obviously injected into another class.
With these changes, the RAR could be deployed in JBoss 5 by packaging the RAR, datasource and client WAR into an EAR file and using some voodo classloading magic.
Here's the datasource:
<connection-factories> <tx-connection-factory> <jndi-name>/jcr/datastore</jndi-name> <xa-transaction/> <rar-name>modeshape-datastore.ear#modeshape-jca-3.3-SNAPSHOT.rar</rar-name> <connection-definition>javax.jcr.Repository</connection-definition> <config-property name="repositoryURL" type="java.lang.String">file:/d:/Temp/modeshapecfg.json</config-property> <max-pool-size>9</max-pool-size> </tx-connection-factory> </connection-factories>
Here's the jboss-classloading.xml (based on support ticket https://access.redhat.com/site/solutions/236303 ) :
<classloading xmlns="urn:jboss:classloading:1.0" name="modeshape-datastore.ear" parent-domain="NoHibernateNoJBLoggingDomain" domain="modeshape-datastore.ear" import-all="true" export-all="NON_EMPTY" parent-first="false" excluded="javax.transaction,javax.transaction.xa"> </classloading>