Bug 1016995 - Deployment Overlay feature is not able to replace the application libraries.
Deployment Overlay feature is not able to replace the application libraries.
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management (Show other bugs)
6.1.0
All All
unspecified Severity high
: DR1
: EAP 6.3.0
Assigned To: Stuart Douglas
Jan Martiska
Nichola Moore
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-09 02:34 EDT by Jay SenSharma
Modified: 2015-07-19 20:59 EDT (History)
8 users (show)

See Also:
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 11:30:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
An ANT based simple WAR as a testcase with the exception / replication details (5.23 KB, application/zip)
2013-10-09 02:34 EDT, Jay SenSharma
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker EAP6-60 Major Closed Allow deployment overlay feature to replace application libraries 2017-03-09 04:53 EST
JBoss Issue Tracker WFLY-1359 Major Resolved Make deployment overlays work when adding resource roots 2017-03-09 04:53 EST
JBoss Issue Tracker WFLY-2266 Major Resolved Deployment Overlay feature is not able to replace the application libraries. 2017-03-09 04:53 EST
Red Hat Knowledge Base (Solution) 383393 None None None Never

  None (edit)
Description Jay SenSharma 2013-10-09 02:34:52 EDT
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 03:52:45 EST
Stuart Douglas <stuart.w.douglas@gmail.com> updated the status of jira WFLY-2266 to Resolved
Comment 3 Jan Martiska 2014-03-04 06:26:36 EST
Verified in 6.3.0.DR1.
Comment 4 James Livingston 2014-06-04 21:50:40 EDT
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 11:09:04 EDT
John Doyle <jdoyle@jboss.org> updated the status of jira EAP6-60 to Closed

Note You need to log in before you can comment on or make changes to this bug.