2016-11-25 61 views
0

基於JEE 7教程中的Trading Connector示例,我試圖創建自己的資源適配器。它用玻璃魚很好。在Wildfly上部署資源適配器WFLYJCA0046/IJ020066

我試圖將我的.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) 

我看不出有什麼理由,一個ClassLoader,可以看到ConnectionFactoryImpl也不能看到該接口。我早些時候在不同的jar中使用了這個接口(所以我不需要從rar爲客戶端生成一個jar),並且產生了相同的錯誤。

我保持這個簡短,所以請問什麼時候缺少東西,我會及時添加它。

回答

0

問題是我需要EJB中有一個客戶端的接口類到這個RA。在那裏,我沒有指定從.rar創建的.jar爲<scope>provided</scope>,所以在最後.ear我有ra-api.jarra.rar,其中包含接口.class