How to solve JBAS014803: Duplicate resource

This quick tutorial discusses how to fix the error “Duplicate resource” which you can find at start up or upon deployment of a resource on WildFly.

Which is the duplicate resource?

Firstly, we need to establish which is the resource is causing the error. Consider the following error message:

05:17:13,199 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 12) JBAS014613: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "MyDatabaseDS")
]) - failure description: "JBAS014803: Duplicate resource [
    (\"subsystem\" => \"datasources\"),
    (\"data-source\" => \"MyDatabaseDS\")
]"

In the above example, you have attempted to configure the resource MyDatabaseDS in WildFly. However, the server already contains a definition for that resource.

As a rule of thumb, check if your application attempts to re-define that resource definition as XML file. Either remove the definition from the standalone.xml file or from your application.

Another possibility is that the duplicate resource is the application which you are deploying:

06:20:50,037 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread)
 JBAS014612: Operation ("add") failed - address: ([("deployment" => "application.ear")]) - failure description:
"JBAS014803: Duplicate resource [(\"deployment\" => \"application.ear\")]"

In this case, we recommend restarting the application server in admin-only mode:

./standalone.sh --admin-only

Then from the CLI, remove the existing application:

undeploy application.ear

In addition, if you are copying applications under the deployments folder, we recommend deleting all the .failed files.

You should now be able to restart the application server and deploy your application.


Recommended Articles

[Solved] Fix "Failed to start service jboss.deployment.unit" in WildFly

Learn how to solve the 'Failed to start service jboss.deployment.unit' error in WildFly & JBoss EAP. Decode deployment phases (.PARSE, .DEPENDENCIES, .INSTALL) and fix root causes.

Deploy Your Enterprise Application with WildFly: A Comprehensive Guide

Learn how to deploy a .war file on WildFly, including file system deployment and management tools. #WildFly #JavaDeployment #Middleware

Manage Exploded Deployments in WildFly for Efficient Java Enterprise Applications

Learn how to configure and explode deployments in WildFly for efficient Java enterprise applications. Discover the benefits of exploded deployments and get step-by-step guides on configuring and exploding your WildFly deployment.

Deploy Applications Remotely Using WildFly 26 - A Comprehensive Guide

Learn how to deploy applications remotely using WildFly 26, including setup and command line methods.