JCA Glassfish 两个 JBoss/Wildfly

JCA Glassfish to JBoss/Wildfly

我需要能够将包含 .rar 资源适配器的 .ear 文件部署到 jBoss/Wildfly。它以前一直在为GF工作。问题是在我的 .war 文件中(这也是 .ear 的一部分)我有这个 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>

和jBoss找不到资源:

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]"]}

我在 standalone.xml 中创建了元素,但接缝命名错误或什么:

<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>

如果我有 .rar 打包在 .ear 中,只用 [=37= 部署就够了吗? ]?资源适配器 JNDI 名称定义在哪里?

问题出在 ra.xml,其中包名称设置不正确,Glassfish 在 JBoss 失败时忽略了这一点。修复工厂包名称解决了这个问题。