1

我正在尝试为 jgroups 频道使用服务激活器。我在 META-INF/services/ 中放置了一个名为:org.jboss.msc.service.ServiceActivator 的文件,该文件的内容类似于 com.blahblah.project.cluster.JGroupsServiceActivator,它是 JGroupsServiceActivator 存在的实际位置文件。

我的部署是一个 ear 包,里面有一个 jar 和一个 war 文件。但是,当我尝试部署我的应用程序时,我不断收到以下错误:

11:45:52,222 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.util.ServiceConfigurationError: org.jboss.msc.service.ServiceActivator: Provider com.blahblah.proj.cluster.JGroupsServiceActivator not found
    at java.util.ServiceLoader.fail(ServiceLoader.java:231) [rt.jar:1.7.0_25]
    at java.util.ServiceLoader.access$300(ServiceLoader.java:181) [rt.jar:1.7.0_25]
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365) [rt.jar:1.7.0_25]
    at java.util.ServiceLoader$1.next(ServiceLoader.java:445) [rt.jar:1.7.0_25]
    at org.jboss.as.server.deployment.service.ServiceActivatorProcessor.deploy(ServiceActivatorProcessor.java:60) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    ... 5 more

11:45:52,419 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."proj-ear.ear"."proj-ejb-0.61.1-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "proj-ejb-0.61.1-SNAPSHOT.jar" of deployment "proj-ear.ear"

它没有找到提供者。有什么想法吗?这里 JgroupsServiceActivator 是我自己在 jar 中的类。如何使这个文件对 jboss 显式可见?

4

2 回答 2

1

尝试org.jboss.as.server在项目清单 ( war/META-INF/MANIFEST.MF) 中添加依赖项。

于 2014-09-18T18:39:42.353 回答
0

它类似于 gcvt 的答案,但这就是为我解决问题的方法 - 将依赖模块 'org.jboss.as.server' 添加到 jboss-deployment-structure.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
  <deployment>
    <dependencies>
        <module name="org.jgroups"/>
        <module name="org.jboss.as.naming"/>
        <module name="org.jboss.as.clustering.jgroups"/>
        <module name="org.infinispan"/>
        <module name="org.jboss.as.server"/>
    </dependencies>
  </deployment>
</jboss-deployment-structure>
于 2015-02-10T10:59:30.367 回答