在 Wildfly 上部署资源适配器 WFLYJCA0046 / IJ020066

Deployment of Resource Adapter on Wildfly WFLYJCA0046 / IJ020066

基于 JEE 7 教程中的交易连接器示例,我尝试创建自己的资源适配器。它适用于 glassfish。

我正在尝试将我的 .EAR 部署到 wildfly 10。它不起作用,并在下方显示消息。我有点不知道从哪里开始寻找,因为唯一提到的错误代码是在 wildfly 本身的源代码中,我宁愿现在不阅读所有 Wildfly 代码(但我正在阅读)。

资源适配器是 .ear 文件的一部分,在那个 ear 文件中我有一个 ejb 项目是这个 RA 的客户端,为了编译 ejb 我创建了一个 ra-lib.jar仅包含 api 包中条目的 rar。

结构.rar:

./META-INF
./META-INF/maven
./META-INF/maven/root.project
./META-INF/maven/root.project/ra
./META-INF/maven/root.project/ra/pom.xml
./META-INF/maven/root.project/ra/pom.properties
./META-INF/MANIFEST.MF
./root
./root/project
./root/project/ra
./root/project/ra/api
./root/project/ra/api/DummyRAConnectionFactory.class
./root/project/ra/api/DummyRAConnection.class
./root/project/projects
./root/project/projects/dummy
./root/project/projects/dummy/ra
./root/project/projects/dummy/ra/connection
./root/project/projects/dummy/ra/connection/DummyRAConnectionFactoryImpl.class
./root/project/projects/dummy/ra/connection/DummyRAManagedConnection.class
./root/project/projects/dummy/ra/connection/DummyRAManagedConnectionFactory.class
./root/project/projects/dummy/ra/connection/DummyRAConnectionImpl.class
./root/project/projects/dummy/ra/connection/DummyRAManagedConnection.class
./root/project/projects/dummy/ra/DummyImplementationRAConnector.class

连接工厂负责人:

import java.io.Serializable;
import javax.resource.Referenceable;
import root.project.ra.api.DummyRAConnectionFactory;

public class DummyRAConnectionFactoryImpl implements DummyRAConnectionFactory, Serializable, Referenceable {

错误信息:

08:30:21,440 ERROR [org.jboss.msc.service.fail] (ResourceAdapterDeploymentService Thread Pool -- 1) MSC000001: Failed to start service jboss.raactivator.java_comp_env_eis_DummyRAConnectionFactory: org.jboss.msc.service.StartException in service jboss.raactivator.java_comp_env_eis_DummyRAConnectionFactory: WFLYJCA0046: Failed to start RA deployment [java_comp_env_eis_DummyRAConnectionFactory]
        at org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService.run(AbstractResourceAdapterDeploymentService.java:325)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jboss.threads.JBossThread.run(JBossThread.java:320)
    Caused by: org.jboss.jca.deployers.common.DeployException: IJ020066: Connection factory implementation (root.project.projects.dummy.ra.connection.DummyRAConnectionFactoryImpl) doesn't implement connection factory interface (root.project.ra.api.DummyRAConnectionFactory)
        at org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:1348)
        at org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator.doDeploy(ResourceAdapterActivatorService.java:171)
        at org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService.start(ResourceAdapterActivatorService.java:115)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

我看不出有什么理由可以看到 ConnectionFactoryImpl 的 ClassLoader 也不能看到接口。我之前在另一个 jar 中有接口(这样我就不需要从 rar 为客户生成 jar)并且产生了同样的错误。

我写的很简短,有什么不对请追问,我会及时补充。

问题是我需要 EJB 中的接口 类,该接口具有此 RA 的客户端。在那里,我没有指定我从 .rar 创建的 .jar 作为 <scope>provided</scope> 所以在最后的 .ear 我有 ra-api.jarra.rar 两者都包含接口 .class.