How to solve Failed to start service jboss.deployment.unit

In this short article we will learn how to solve a common error which you can hit at deployment time: “failed to start service jboss.deployment.unit”.

Understanding the deployment failure

The “Failed to start service jboss.deployment.unit” error in WildFly typically occurs when there is an issue with the deployment of an application or module. When WildFly attempts to start the deployment, it encounters an error and is unable to start the service.

There are several possible reasons for this error, including:

  1. Incorrect configuration: The deployment may contain configuration settings that are not valid or are conflicting with other settings in the application server. This can cause WildFly to fail to start the service.
  2. Dependency issues: The deployment may have dependencies on other modules or services that are not available or are not properly configured in WildFly. This can cause WildFly to fail to start the service.
  3. Corrupted deployment: The deployment package or its contents may be corrupted or incomplete, causing WildFly to fail to start the service.

Let’s see a practical example. Check the following error log:

16:55:43,635 INFO  [] (MSC service thread 1-6) WFLYSRV0027: Starting deployment of "helloworld-mdb.war" (runtime-name: "helloworld-mdb.war")
16:55:43,642 ERROR [] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."helloworld-mdb.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloworld-mdb.war".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "helloworld-mdb.war"
	at [email protected]//
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$
	at [email protected]//
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$
	at java.base/
Caused by: org.jboss.msc.service.ServiceNotFoundException: service jboss.ejb.default-resource-adapter-name-service not found

As you can see, we have attempted to deploy the helloworld-mdb.war application but it failed. The error message does not help too much in finding the root cause. However, if you look into the Stack Trace you will see what is causing the error:

failed to start service jboss.deployment.unit

As you can see, it’s missing the service jboss.ejb.default-resource-adapter-name-service.

To solve the issue, you should therefore find out why the above service is not available. In this case, there can be two potential causes for this issue:

  • You are using a profile which does not include this service (f.e. the standalone.xml configuration)
  • You are missing the resource adapter indicated in your configuration (f.e. the activemq-ra-rar Resource adapter)
       <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
       <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>

In other cases, there are no missing services but you are trying to provide a service with a faulty configuration. See the following example:

ERROR [] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."crc-ds.xml".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."crc-ds.xml".PARSE: Failed to process phase PARSE of deployment "mysql-ds.xml"
    at [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask( [rt.jar:1.6.0_45]
    at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.6.0_45]
    at [rt.jar:1.6.0_45]
Caused by: Received non-all-whitespace CHARACTERS or CDATA event in nextTag(). at [row,col {unknown source}]: [95,0]

In the above example, there is a failure in parsing a Datasource configuration file (mysql-ds.xml) which you have added in your application or in the deployments folder.

As a rule of thumb to solve this error, always check which is the Root cause that causes your deployment to fail. In most cases, the Caused by contains the root cause.

Finally, a complex Framework can create a dozen or more Caused by: sections. Therefore, a good strategy is to jump down those looking for your own code: Caused by: com.myproject. This is your first step to isolate the problem.


By following these steps, you can diagnose and resolve the “Failed to start service jboss.deployment.unit” error in WildFly and get your application up and running again.