根据JEE 7教程中的Trading Connector示例,我尝试创建自己的资源适配器。它适用于玻璃鱼。
我试图将我的.EAR部署到一只野蝇10上。它不起作用,并且正在抛出下面的信息。我有点迷失在哪里开始寻找,因为唯一提到的错误代码是在wildfly本身的源代码中,而我现在不想读取所有的Wildfly代码(但是我在这里)
资源适配器是.ear文件的一部分,在那个ear文件中我有一个ejb项目,它是这个RA的客户端,为了ejb编译,我创建了一个包含rar的ra-lib.jar只有api包中的条目。
.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$1.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$2.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)并且产生了同样的错误。
我保留了这个简短的内容,所以请在缺少某些内容时询问,我会及时添加。
答案 0 :(得分:0)
问题是我需要EJB中具有此RA客户端的接口类。在那里,我没有将.rar创建的.jar指定为<scope>provided</scope>
所以在最后的.ear中我有ra-api.jar
和ra.rar
两个包含接口{ {1}}。