You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Olivier Billard <ol...@laposte.net> on 2007/07/04 16:49:35 UTC

Re: Cocoon Maven plugin - Merging deployer & rcl

Guys,

I plug into your thread because I'm right into it : I checked-out the Cocoon ACEGI sample, completed it and tested it, it's great.
But I've got trouble with the xweb file : using the block-only rcl webapp, patch is correctly applied, but I would like to make my app security with 
ACEGI a block (seems promising with ACEGI as a filter and xweb), but such a block included into a webapp block does not triggers web.xml patching when 
calling "mvn package".

Did I missed something ?
Thanks a lot for your answers !

--
Olivier Billard


Giacomo Pati wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> 
> Reinhard Poetz wrote:
>>>> The second one allows "patching" the web.xml by adding snippets from
>>>> META-INF/cocoon/xpatch to it. It also supports a feature that reverses
>>>> the classloader hierarchy in a web application by using a shielding
>>>> classloader.
>>> But can only be used if packaging of the project is war!
>> I ported the patching functionality to cocoon:rcl too. In order to be
>> consistent with our other directory names, the plugins search for patch
>> files in /COB-INF/cocoon/xpatch/*.xweb.
> 
> What was the reason to change the path from /META-INF/cocoon/xpatch/*.xweb to
> /COB-INF/cocoon/xpatch/*.xweb? It's confusing to me to change that.
> 
>> But I have to admit that I only tested it very basically because I don't
>> really use it myself.
> 
> That's why I'm trying and asking ;-)
> 
> Ciao and thanks
> 
> - --
> Giacomo Pati
> Otego AG, Switzerland - http://www.otego.com
> Orixo, the XML business alliance - http://www.orixo.com
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.3 (GNU/Linux)
> 
> iD4DBQFGOFm8LNdJvZjjVZARAiVmAJQLqqVe+SGxOigcyUzRmFze33veAKDtsGR5
> 4sA6xjYRM6ZIrTzsvLbgOg==
> =16x4
> -----END PGP SIGNATURE-----
> 


Re: Cocoon Maven plugin - Merging deployer & rcl

Posted by Olivier Billard <ol...@laposte.net>.
Reinhard Poetz wrote:
> Olivier Billard wrote:
>> Reinhard Poetz wrote:
>>> Olivier Billard wrote:
>>>> Guys,
>>>>
<snip/>
> 
> Olivier,
> 
> thanks for your investigations. Could you please file a Jira bug report? 
> Thanks!
> 
> 

Done.


Re: Cocoon Maven plugin - Merging deployer & rcl

Posted by Reinhard Poetz <re...@apache.org>.
Olivier Billard wrote:
> Reinhard Poetz wrote:
>> Olivier Billard wrote:
>>> Guys,
>>>
>>> I plug into your thread because I'm right into it : I checked-out the 
>>> Cocoon ACEGI sample, completed it and tested it, it's great.
>>> But I've got trouble with the xweb file : using the block-only rcl 
>>> webapp, patch is correctly applied, but I would like to make my app 
>>> security with ACEGI a block (seems promising with ACEGI as a filter 
>>> and xweb), but such a block included into a webapp block does not 
>>> triggers web.xml patching when calling "mvn package".
>>>
>>> Did I missed something ?
>>
>> Yes, you have to use the deployer goal ('mvn cocoon:deploy') in order 
>> to get your xweb patches applied. The package plugin isn't aware of 
>> Cocoon's xweb patching mechanism.
>>
> 
> 
> Thank you for your answer Reinhard, I really missed this plugin part, 
> sorry.
> 
> <note>
> This could be continued in the users list if you think this is more suited.
> Nevertheless, as this seems to be a bug in the dev version (not released 
> yet), I continue on the dev list for the moment.
> </note>
> 
> This perfectly works with the "deploy" mojo, but not for the 
> "deploy-war" one, with exactly the same configuration.
> I meet a strange phenomenon, that could possibly be a bug in the 
> cocoon-maven-plugin ? web.xml patch is not applied with the 
> "deploy-war", except after a "deploy" mojo call :). Of course these 
> mojos are not meant to be called one after the other, but this could be 
> a clue for resolution: maybe a context is not properly initialized when 
> "deploy-war" mojo is called alone?
> 
> 
> Maven outputs below.

Olivier,

thanks for your investigations. Could you please file a Jira bug report? Thanks!


-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Re: Cocoon Maven plugin - Merging deployer & rcl

Posted by Olivier Billard <ol...@laposte.net>.
Reinhard Poetz wrote:
> Olivier Billard wrote:
>> Guys,
>>
>> I plug into your thread because I'm right into it : I checked-out the 
>> Cocoon ACEGI sample, completed it and tested it, it's great.
>> But I've got trouble with the xweb file : using the block-only rcl 
>> webapp, patch is correctly applied, but I would like to make my app 
>> security with ACEGI a block (seems promising with ACEGI as a filter 
>> and xweb), but such a block included into a webapp block does not 
>> triggers web.xml patching when calling "mvn package".
>>
>> Did I missed something ?
> 
> Yes, you have to use the deployer goal ('mvn cocoon:deploy') in order to 
> get your xweb patches applied. The package plugin isn't aware of 
> Cocoon's xweb patching mechanism.
> 


Thank you for your answer Reinhard, I really missed this plugin part, sorry.

<note>
This could be continued in the users list if you think this is more suited.
Nevertheless, as this seems to be a bug in the dev version (not released yet), I continue on the dev list for the moment.
</note>

This perfectly works with the "deploy" mojo, but not for the "deploy-war" one, with exactly the same configuration.
I meet a strange phenomenon, that could possibly be a bug in the cocoon-maven-plugin ? web.xml patch is not applied with the "deploy-war", except 
after a "deploy" mojo call :). Of course these mojos are not meant to be called one after the other, but this could be a clue for resolution: maybe a 
context is not properly initialized when "deploy-war" mojo is called alone?


Maven outputs below.

--
Olivier Billard


--> This works:
<snip/>
[INFO] ----------------------------------------------------------------------------
[INFO] Building ACEGI Security Sample - Webapp
[INFO]    task-segment: [clean, cocoon:deploy]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
<snip/>
[INFO] [cocoon:deploy]
[INFO] Exploding webapp...
[INFO] Assembling webapp webapp in <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Applying patches to: WEB-INF/web.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
<snip/>

--> This does not work:
<snip/>
[INFO] ----------------------------------------------------------------------------
[INFO] Building ACEGI Security Sample - Webapp
[INFO]    task-segment: [clean, cocoon:deploy-war]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
<snip/>
[INFO] [cocoon:deploy-war]
[INFO] Exploding webapp...
[INFO] Assembling webapp webapp in <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to <snip/>\webapp\target\webapp-1.0-SNAPSHOT
[INFO] No patches to apply    <-- *oops*
[INFO] Generating war E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT.war
[INFO] Building war: E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
<snip/>

--> This works, but hum...
<snip/>
[INFO] ----------------------------------------------------------------------------
[INFO] Building ACEGI Security Sample - Webapp
[INFO]    task-segment: [clean, cocoon:deploy, cocoon:deploy-war]
[INFO] ----------------------------------------------------------------------------
[INFO] [clean:clean]
<snip/>
[INFO] [cocoon:deploy]
[INFO] Exploding webapp...
[INFO] Assembling webapp webapp in E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Applying patches to: WEB-INF/web.xml   <-- *patch applied 1 time ...*
[INFO] [cocoon:deploy-war]
[INFO] Exploding webapp...
[INFO] Assembling webapp webapp in E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Copy webapp webResources to E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT
[INFO] Applying patches to: WEB-INF/web.xml   <-- *and again a second time. Here deploy-war mojo applies the patch*
[INFO] Generating war E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT.war
[INFO] Building war: E:\Dev\soprano-ng\sources\sandbox\example-apps\acegi-example\webapp\target\webapp-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
<snip/>


Re: Cocoon Maven plugin - Merging deployer & rcl

Posted by Reinhard Poetz <re...@apache.org>.
Olivier Billard wrote:
> Guys,
> 
> I plug into your thread because I'm right into it : I checked-out the 
> Cocoon ACEGI sample, completed it and tested it, it's great.
> But I've got trouble with the xweb file : using the block-only rcl 
> webapp, patch is correctly applied, but I would like to make my app 
> security with ACEGI a block (seems promising with ACEGI as a filter and 
> xweb), but such a block included into a webapp block does not triggers 
> web.xml patching when calling "mvn package".
> 
> Did I missed something ?

Yes, you have to use the deployer goal ('mvn cocoon:deploy') in order to get 
your xweb patches applied. The package plugin isn't aware of Cocoon's xweb 
patching mechanism.

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------