Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1936

Fix JCA adapter to better comply with the specification

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.3.0.Final
    • 3.2.0.Final
    • Server
    • 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>
      

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: