SAR文件导致Wildfly 10中出现部署问题

时间:2016-11-29 11:19:08

标签: java jboss wildfly jmx mbeans

我正在尝试在wildFly 10中部署包含sar模块的.ear。

我收到以下错误摘要:

2016-11-29 11:20:12,376 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "forecast-service-11.0.1-SNAPSHOT.ear")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "jboss.mbean.service.jboss:service=Naming.create",
        "jboss.mbean.service.jboss:service=Naming.start"
    ],
    "WFLYCTL0180: Services with missing/unavailable dependencies" => [
        "jboss.mbean.service.\"com.retx.forecastInject:service=InjectServiceMbean\".start is missing [jboss.mbean.service.jboss:service=Naming.start]",
        "jboss.mbean.service.\"com.retx.forecastInject:service=InjectServiceMbean\".create is missing [jboss.mbean.service.jboss:service=Naming.create]"
    ]
}

sar模块包含以下jboss-service.xml:

<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
    <mbean code="com.retx.forecast.initService.InjectService" 
           name="com.retx.forecastInject:service=InjectServiceMbean">
        <!--  attribute name="JndiName">inmemory/maps/MapTest</attribute-->
        <depends>jboss:service=Naming</depends>
    </mbean>
</server>

InjectServiceMBean.java如下所示:

package com.retx.forecast.initService;

public interface InjectServiceMBean {
    public void start() throws Exception;
    public void stop() throws Exception;
}

InjectService.java如下所示:

package com.retx.forecast.initService;

import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.apache.log4j.Logger;
//other imports

public class InjectService implements InjectServiceMBean {
    private static Logger _log = Logger.getLogger(InjectService.class);

    public void start() throws Exception {
        //some code
    }

    public void stop() throws Exception {
        //some code
    }

}

我进行了广泛的搜索和搜索,但只发现了类似的问题。我非常感谢你的帮助。

1 个答案:

答案 0 :(得分:1)

我从jboss-service.xml中删除了该元素 现在它已成功部署。它的方式在JBoss 4.2.3中很好,但在Wildfly 10中由于某种原因引起了问题。也许这种依赖在Wildfly 10中免费提供....