How to Solve Wildfly Error Message : WFLYCTL0212: Duplicate resource

An odd situation occurred when the situation depicted as in the title of this article is happened. It is at the time of running or deploying a project using either IDE like Netbeans and then after that deploying the same or different project using a command line. The command line in the context of this article is the maven builder tool command line.

The command line executed is ‘mvn wildfly:deploy’ which is used to deploy an associated project where the command executed. The execution of this command to an already deployed application can trigger the following error message of a ‘duplicate resource’ :

After try to search and googling around to solve the problem which at first the specified deployed application will be defined in the configuration file located in Wildfly Java Application Server, it turns out that the configuration file ‘standalone.xml’ which is used doesn’t have the deployment definition. After digging more, it turns out that there are another configuration file named ‘standalone-full.xml which is inserted with the deployment definition as shown in the following part of configuration lines :

The deployment name is ‘webapp-1.0-SNAPSHOT.war’ in the context of the above configuration part. To be able to solve the problem, just remove the deployment line part, so the standalone-full.xml will be edited as follows :

The one which is removed off course the deployment line of configuration which is causing the duplicate resource as shown above. After finish on editing the file, don’t forget to turn off and then start the Wildfly Java Application Server again. It is an action to implement the configuration file so that the running Wildfly Java Application Server will start running using the already edited configuration file. The editing process above by removing the deployment definition is actually solving the problem.