Bug 1151435 - [GSS] (6.4.0) Behaviour of overlays with wildcards is inconsistent
Summary: [GSS] (6.4.0) Behaviour of overlays with wildcards is inconsistent
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CLI
Version: 6.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: DR11
: EAP 6.4.0
Assignee: Alexey Loubyansky
QA Contact: Petr Kremensky
URL: https://access.redhat.com/support/cas...
Whiteboard:
Depends On:
Blocks: 1154108
TreeView+ depends on / blocked
 
Reported: 2014-10-10 11:59 UTC by Shaun Appleton
Modified: 2019-08-19 12:44 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1154108 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFCORE-187 0 Major Resolved cli deployment-overlay --redeploy-affected should check subdeployments as well 2018-03-16 14:56:42 UTC
Red Hat Issue Tracker WFLY-3999 0 Major Closed cli deployment-overlay --redeploy-affected should check subdeployments as well 2018-03-16 14:56:42 UTC

Description Shaun Appleton 2014-10-10 11:59:48 UTC
Adding an overlay with wildcards in 3 steps as follows works:

[standalone@localhost:9999 /] deployment-overlay add --name=myoverlay2 --content=/META-INF/persistence.xml=/home/sappleton/persistence.xml
[standalone@localhost:9999 /] deployment-overlay link --name=myoverlay2 --deployments=jboss-kitchensink-ear-*.jar
[standalone@localhost:9999 /] /deployment=jboss-kitchensink-ear.ear:redeploy


Adding an overlay with wildcards as follows fails:

[standalone@localhost:9999 /] deployment-overlay add --name=myoverlay4 --content=/jboss-kitchensink-ear-*.jar/META-INF/persistence.xml=/home/sappleton/persistence.xml --deployments=jboss-kitchensink-*.ear --redeploy-affected

But the surprising thing is the content/ directory is updated with the correct file (copy of persistence.xml) and the standalone.xml file gets updated to refer to the correct file ie.

        <deployment-overlay name="myoverlay4">
            <content path="/jboss-kitchensink-ear-*.jar/META-INF/persistence.xml" content="fe9d945e86732be60449eb2ce86d67c77293d730"/>
            <deployment name="jboss-kitchensink-*.ear"/>
        </deployment-overlay>


But the expected change is never seen in the server.log


This test was conducted using jboss-kitchensink-ear.ear from the eap quickstarts and modifying the show_sql within the persistence.xml 

Note that debug logging of org.hibernate was required to see the change (or not) in the server.log file

So the one-line approach ingores the wildcard in jboss-kitchensink-ear-*.jar
Whereas the 3 line approach doesn't.

Comment 1 Shaun Appleton 2014-10-10 14:17:11 UTC
I have discussed this via internal irc with Alexey

We came to the following conclusions - 

There are some differences between the two scenarios...

The 2 apporaches are not equivalent

The following one line approach is equivalent to the 3 line approach above

[standalone@localhost:9999 /] deployment-overlay add --name=myoverlayC --content=/META-INF/persistence.xml=/home/sappleton/persistence.xml --deployments=jboss-kitchensink-ear-*.jar --redeploy-affected

and as this applies to the jar and the .jar is not a deployment you have to force a deployment by using:

[standalone@localhost:9999 /] /deployment=jboss-kitchensink-ear.ear:redeploy

and this works fine.

so the question is should 

[standalone@localhost:9999 /] deployment-overlay add --name=myoverlay4 --content=/jboss-kitchensink-ear-*.jar/META-INF/persistence.xml=/home/sappleton/persistence.xml --deployments=jboss-kitchensink-*.ear --redeploy-affected

work?

Comment 2 Shaun Appleton 2014-10-10 14:44:58 UTC
echo-dmr output:

[standalone@localhost:9999 /] echo-dmr deployment-overlay add --name=myoverlay6 --content=/jboss-kitchensink-ear-*.jar/META-INF/persistence.xml=/home/sappleton/persistence.xml --deployments=jboss-kitchensink-*.ear --redeploy-affected  
{
    "operation" => "composite",
    "address" => [],
    "steps" => [
        {
            "address" => [("deployment-overlay" => "myoverlay6")],
            "operation" => "add"
        },
        {
            "address" => [
                ("deployment-overlay" => "myoverlay6"),
                ("content" => "/jboss-kitchensink-ear-*.jar/META-INF/persistence.xml")
            ],
            "operation" => "add",
            "content" => {"bytes" => bytes {
                0x3c, 0x3f, 0x78, 0x6d, 0x6c, 0x20, 0x76, 0x65,
                ...,
                ...,
                ...,
                0x6e, 0x63, 0x65, 0x3e, 0x0a
            }}
        },
        {
            "address" => [
                ("deployment-overlay" => "myoverlay6"),
                ("deployment" => "jboss-kitchensink-*.ear")
            ],
            "operation" => "add"
        },
        {
            "address" => [("deployment" => "jboss-kitchensink-ear.ear")],
            "operation" => "redeploy"
        }
    ]
}
[standalone@localhost:9999 /]

Comment 3 Stuart Douglas 2014-10-10 21:43:03 UTC
I think this is a CLI issue. --redeploy-affected is a convenience method implemented in the CLI,  and for this to work for subdeployments it should also look at sub deployment names when determining what to deploy (not just top level deployments).

Comment 5 JBoss JIRA Server 2014-11-10 13:09:35 UTC
Alexey Loubyansky <alex> updated the status of jira WFLY-3999 to Resolved

Comment 6 Alexey Loubyansky 2014-11-20 14:59:15 UTC
The PR is https://github.com/jbossas/jboss-eap/pull/2002

Comment 7 Petr Kremensky 2014-12-01 15:50:55 UTC
Verified on EAP 6.4.0.DR11.

deployment-overlay add --name=myoverlay --content=/META-INF/persistence.xml=/tmp/persistence.xml --deployments=jboss-kitchensink-ear-*.jar --redeploy-affected

the deployment overlay is used and the application is redeployed.


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