I am new to Jboss EAP. I have Jboss EAP 6.4 installed on RHEL 7. My application.war is successfully deployed on standalone server. Everytime I have a change in application.war , I redeploy (or undeploy and deploy again) the war file through jboss cli. Re-deployment gives no issue in either case. However, for whatever reason if I have to restart the jboss server, I get Duplicate resource error as below.
^[[0m^[[31m11:01:51,585 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Operation ("add") failed - address: ([("deployment" => "application.war")]) - failure description: "JBAS014803: Duplicate resource [(\"deployment\" => \"application.war\")]"
^[[0m^[[31m11:01:51,589 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
^[[0m^[[0m11:01:51,606 INFO [org.jboss.as] (MSC service thread 1-9) JBAS015950: JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21) stopped in 9ms
Below are the exact steps I followed:
1. Started jboss in standalone mode.
2. Copied application.war in jboss/standalone/deployments
3. At this point, app is deployed successfully.
4. I have an updated war , available at /different/path/application.war
5. I invoke jboss-cli.sh and deploy /different/path/application.war --force
6. application.war is deployed successfully and new changes are accessible to testers.
7. For any reason, server has to be restarted. I shutdown standalone server from jboss-cli.
8. start standalone server - Deployment fails with above error.
9. To rectify, I delete deployment from standalone.xml and start the server again. At this point old application.war (from point 2) gets deployed. So I have to repeat 5 & 6 to deploy the latest version.
I am not sure if I am doing anything wrong here. Any inputs /suggestions on how to re-deploy existing app from jboss cli to avoid above issue?
My recommendation is to be consistent with your deployment method.
Normally a file should be deployed and undeployed by using the same method (deployment scanner, CLI or the management console).