Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JCA Glassfish to JBoss/Wildfly

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?

like image 902
Zveratko Avatar asked Jun 10 '15 14:06

Zveratko


1 Answers

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.

like image 159
Zveratko Avatar answered Sep 19 '22 06:09

Zveratko