JCA Glassfish to JBoss/Wildfly

666 Views Asked by At

I need to be able to deploy .ear file containing .rar resource adapter to jBoss/Wildfly. It has been working previously for GF. Problem is that in my .war file (which is also part of the .ear) I have this web.xml:

<resource-ref>
  <res-ref-name>eis/host</res-ref-name>
  <res-type>javax.resource.cci.ConnectionFactory</res-type>
  <res-auth>Container</res-auth>
  <res-sharing-scope>Shareable</res-sharing-scope>
  <lookup-name>java:/env/eis/host-somehost</lookup-name>
</resource-ref>

and jBoss cannot find the resource:

Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.\"HostConnector-ear-1.17-SNAPSHOT\".\"HostConnector-war-1.17-SNAPSHOT\".env.eis.host is missing          [jboss.naming.context.java.jboss.resources.eis.host]"]}

I have created element in standalone.xml, but seams the naming is wrong or what:

<subsystem xmlns="urn:jboss:domain:resource-adapters:2.0">
        <resource-adapters>
            <resource-adapter id="Host-ra">
                <archive>
                    HostConnector-1.17-SNAPSHOT-local#HostConnector-rar-1.17-SNAPSHOT.rar
                </archive>
                <connection-definitions>
                    <connection-definition class-name=".....jca.spi.HostManagedConnectionFactory" jndi-name="java:/env/eis/host-somehost" enabled="true" use-java-context="false" pool-name="java:jboss/env/eis/host-somehost"/>
                </connection-definitions>
            </resource-adapter>
        </resource-adapters>
    </subsystem>

If I have .rar packaged in .ear is it enough to just deploy with ra.xml? Where is the resource-adapter JNDI name defined?

1

There are 1 best solutions below

0
On BEST ANSWER

The problem was in ra.xml, where the packages names were not properly set and Glassfish ignored this while JBoss failed. fixing the factories package name fixed that issue.