Deployment of Resource Adapter on Wildfly WFLYJCA0046 / IJ020066

 ̄綄美尐妖づ 提交于 2019-12-25 16:45:08

问题


Based on the Trading Connector example from the JEE 7 Tutorials, I've tried to create my own Resource adapter. It worked fine with glassfish.

I'm trying to deploy my .EAR to a wildfly 10. It doesn't work, and is throwing the message below. I am kinda lost on where to start looking, as the only mention of the error code is in the source code of wildfly itself and I'd rather not read all the Wildfly code now (but I'm at it).

The Resource Adapter is part of a .ear file, in that ear file I have an ejb project that is client to this RA, in order for the ejb to compile I create a ra-lib.jar alongside the rar that contains only the entries from the api package.

Structure of the .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

Head of Connection Factory:

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

public class DummyRAConnectionFactoryImpl implements DummyRAConnectionFactory, Serializable, Referenceable {

Error message:

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)

I can see no reason that a ClassLoader that can see the ConnectionFactoryImpl can not also see the interface. I had the interface in a different jar earlier (so that I don't need to produce a jar from the rar for the clients) and that yielded the same error.

I've kept this short, so please ask when something is missing, I will add it promptly.


回答1:


The problem was that I needed the Interface classes in the EJB that has a client to this RA. there, I didn't specify the .jar that I created from the .rar as <scope>provided</scope> so in the final .ear I had the ra-api.jar and the ra.rar that BOTH contained the Interface .class.



来源:https://stackoverflow.com/questions/40799974/deployment-of-resource-adapter-on-wildfly-wflyjca0046-ij020066

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!