Created attachment 809671 [details] An ANT based simple WAR as a testcase with the exception / replication details Description of problem: ----------------------- According to the documentation: [1] the deployment overlay feature is applicable for "swapping out deployment descriptors, modifying static web resources to change the branding of an application, or even replacing jar libraries with different versions." Here it talks about "replacing jar libraries" which is not working as expected and causes the following error. [1] https://docs.jboss.org/author/display/AS72/Deployment+Overlays Version-Release number of selected component (if applicable): How reproducible: ------------------ Follow the below sequence of deployment and overlay: Steps to Reproduce: ------------------ Step-1). ========= Undeploy if any existing application is deployed and then freshly deploy the application. [standalone@localhost:9999 /] undeploy DeploymentOverlayDemo.war [standalone@localhost:9999 /] deploy /home/jaysensharma/TestApp/build/DeploymentOverlayDemo.war Step-2). ========= Make some changes in java code "Hello.java". Create a new JAR Hello.jar which we want to replace at (/WEB-INF/lib/Hello.jar) using deployment-overlay feature. In the attached ant basd Demo just do "ant compile" to create a new Jar "${project.dir}/tmp/Hello.jar" Step-3). ========= Use the following command in order to replace the "/WEB-INF/lib/Hello.jar" with the newly created Hello.jar using deployment overlay feature as following: [standalone@localhost:9999 /] deployment-overlay add --name=myOverLay_1 --content=/WEB-INF/lib/Hello.jar=/home/jaysensharma/TestApp/tmp/Hello.jar --deployments=DeploymentOverlayDemo.war --redeploy-affected Above causes the following Exception: +++++++++++++++++++++++ 11:50:10,152 INFO [org.jboss.web] (ServerService Thread Pool -- 59) JBAS018224: Unregister web context: /DeploymentOverlayDemo 11:50:10,197 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment DeploymentOverlayDemo.war (runtime-name: DeploymentOverlayDemo.war) in 58ms 11:50:10,201 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "DeploymentOverlayDemo.war" (runtime-name: "DeploymentOverlayDemo.war") 11:50:10,211 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service jboss.deployment.unit."DeploymentOverlayDemo.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."DeploymentOverlayDemo.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "DeploymentOverlayDemo.war" at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21] at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018776: Failed to get content for deployment overlay myOverLay_1 at /WEB-INF/lib/Hello.jar at org.jboss.as.server.deployment.ContentOverrideDeploymentUnitProcessor.deploy(ContentOverrideDeploymentUnitProcessor.java:70) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] ... 5 more Caused by: java.io.IOException: Filesystem already mounted at mount point ""/content/DeploymentOverlayDemo.war/WEB-INF/lib/Hello.jar"" at org.jboss.vfs.VFS.mount(VFS.java:132) at org.jboss.vfs.VFS.doMount(VFS.java:354) at org.jboss.vfs.VFS.mountReal(VFS.java:449) at org.jboss.as.server.deployment.ContentOverrideDeploymentUnitProcessor.deploy(ContentOverrideDeploymentUnitProcessor.java:67) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8] ... 6 more 11:50:10,216 ERROR [org.jboss.as.server] (management-handler-thread - 6) JBAS015860: Redeploy of deployment "DeploymentOverlayDemo.war" was rolled back with the following failure message: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"DeploymentOverlayDemo.war\".STRUCTURE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"DeploymentOverlayDemo.war\".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment \"DeploymentOverlayDemo.war\" Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018776: Failed to get content for deployment overlay myOverLay_1 at /WEB-INF/lib/Hello.jar Caused by: java.io.IOException: Filesystem already mounted at mount point \"\"/content/DeploymentOverlayDemo.war/WEB-INF/lib/Hello.jar\"\""}} 11:50:10,219 INFO [org.jboss.as.controller] (management-handler-thread - 6) JBAS014774: Service status report JBAS014777: Services which failed to start: service jboss.deployment.unit."DeploymentOverlayDemo.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."DeploymentOverlayDemo.war".STRUCTURE: JBAS018733: Failed to process phase STRUCTURE of deployment "DeploymentOverlayDemo.war" +++++++++++++++++++++++ Actual results: --------------- - As the mentioned documentation suggest that the deployment overlay is applicable for library jars as well so it should work properly and replace the Jars or the documentation need to be corrected. [1] https://docs.jboss.org/author/display/AS72/Deployment+Overlays Expected results: ----------------- - deployment overlay feature should be able to replace the application library jars. Additional info:
Stuart Douglas <stuart.w.douglas> updated the status of jira WFLY-2266 to Resolved
https://github.com/jbossas/jboss-eap/pull/929 This one comes from https://issues.jboss.org/browse/EAP6-60.
Verified in 6.3.0.DR1.
WFLY-1359 is the upstream bug for adding libraries (WFLY-2266 was replacing them). It was added to EAP 6 at the same time, so I've just added the link for tracking.
John Doyle <jdoyle> updated the status of jira EAP6-60 to Closed