Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1016995

Summary: Deployment Overlay feature is not able to replace the application libraries.
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jay SenSharma <jsenshar>
Component: Domain ManagementAssignee: Stuart Douglas <sdouglas>
Status: CLOSED CURRENTRELEASE QA Contact: Jan Martiska <jmartisk>
Severity: high Docs Contact: Nichola Moore <nmoore>
Priority: unspecified    
Version: 6.1.0CC: dandread, emuckenh, jlivings, jmartisk, kkhan, sjadhav, smumford, wfink
Target Milestone: DR1   
Target Release: EAP 6.3.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In previous releases of JBoss EAP 6, the Deployment Overlay feature was not working as documented. It did not overwrite the application jar libraries as it is supposed to. Changes were made to allow the Deployment Overlay feature to overwrite the application jar libraries, and it now works as documented.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:30:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
An ANT based simple WAR as a testcase with the exception / replication details none

Description Jay SenSharma 2013-10-09 06:34:52 UTC
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:

Comment 1 JBoss JIRA Server 2013-12-10 08:52:45 UTC
Stuart Douglas <stuart.w.douglas> updated the status of jira WFLY-2266 to Resolved

Comment 3 Jan Martiska 2014-03-04 11:26:36 UTC
Verified in 6.3.0.DR1.

Comment 4 James Livingston 2014-06-05 01:50:40 UTC
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.

Comment 5 JBoss JIRA Server 2015-04-28 15:09:04 UTC
John Doyle <jdoyle> updated the status of jira EAP6-60 to Closed