MBean depends tag in JBoss EAP 7.x

Solution Verified - Updated -

Issue

  • When we add MBean dependencies in jboss-service.xml, we are getting the following exception
13:13:10,870 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."example.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."example.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "example.war"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: Empty name segment is not allowed for service
        at org.jboss.msc.service.ServiceName.of(ServiceName.java:90)
        at org.jboss.msc.service.ServiceName.append(ServiceName.java:117)
        at org.jboss.as.service.ServiceNameFactory.newServiceName(ServiceNameFactory.java:55)
        at org.jboss.as.service.ServiceNameFactory.newCreateDestroy(ServiceNameFactory.java:44)
        at org.jboss.as.service.MBeanServices.addDependency(MBeanServices.java:121)
        at org.jboss.as.service.ParsedServiceDeploymentProcessor.addDependencies(ParsedServiceDeploymentProcessor.java:150)
        at org.jboss.as.service.ParsedServiceDeploymentProcessor.addServices(ParsedServiceDeploymentProcessor.java:127)
        at org.jboss.as.service.ParsedServiceDeploymentProcessor.deploy(ParsedServiceDeploymentProcessor.java:109)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
        ... 8 more
  • Our Application depends on the order of MBean dependency. How to define Mbeans with dependency in JBoss 7.3. Here is our jboss-service.xml
<server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="urn:jboss:service:7.0 http://www.jboss.org/schema/jbossas/jboss-service_7_0.xsd"
        xmlns="urn:jboss:service:7.0">

    <mbean code="com.example.FirstServiceExample"
           name="Comapny:service=FirstServiceExample">
    </mbean>

    <mbean code="com.example.SecondServiceExample"
           name="Comapny:service=SecondServiceExample">
           <depends></depends>
    </mbean>
</server>

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.3.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content