Return-Path: X-Original-To: apmail-myfaces-users-archive@www.apache.org Delivered-To: apmail-myfaces-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 852EBF974 for ; Tue, 19 Mar 2013 21:51:38 +0000 (UTC) Received: (qmail 24085 invoked by uid 500); 19 Mar 2013 21:51:37 -0000 Delivered-To: apmail-myfaces-users-archive@myfaces.apache.org Received: (qmail 24036 invoked by uid 500); 19 Mar 2013 21:51:37 -0000 Mailing-List: contact users-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Discussion" Delivered-To: mailing list users@myfaces.apache.org Received: (qmail 24026 invoked by uid 99); 19 Mar 2013 21:51:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 21:51:37 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL,T_FRT_BELOW2 X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [77.238.189.195] (HELO nm13-vm0.bullet.mail.ird.yahoo.com) (77.238.189.195) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 19 Mar 2013 21:51:32 +0000 Received: from [77.238.189.55] by nm13.bullet.mail.ird.yahoo.com with NNFMP; 19 Mar 2013 21:51:09 -0000 Received: from [212.82.98.66] by tm8.bullet.mail.ird.yahoo.com with NNFMP; 19 Mar 2013 21:51:09 -0000 Received: from [127.0.0.1] by omp1003.mail.ir2.yahoo.com with NNFMP; 19 Mar 2013 21:51:09 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 853188.27725.bm@omp1003.mail.ir2.yahoo.com Received: (qmail 73239 invoked by uid 60001); 19 Mar 2013 21:51:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.fr; s=s1024; t=1363729869; bh=+U98HMn1UqvECg//QJV/8oyNT0ua8WkRgtFuec3/WoA=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=G1lS0tGyFZPpS+B0Vd6H3q/55BMjAJA9Ip/00dCk/iJZfqqmlvEShKsn+3XaZy2dA4pex8XzyDiowYWJbC9P3diO8bUU0Y6T7wgLKS2CU89/IPk0oOAKB+lsBY7H0fSLziXc26VjKCpslQW/WY+g2ngrikkAZq4sAku6Hcx+O3s= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.fr; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=2E9jYeB50pCMHLG6+nhFwZS/wGNiqGydR0cYFKhqSK2OL/Mjmz21TQSOq9O2C+M+zvSIk8+I3ybx3ukxjnl2AIpz+CbTDJ/Ot+vPuP+HCd7kX/csI42BynOrQAYGEFA9WpJANmxElzjmfThI+ZtrrFl2beN5+Jeg50iK+8g74pA=; X-YMail-OSG: k0UKz3MVM1leC9YdIiHAgt7S7ci6SiA46VEdZioy2mszY1b NFoexHkW4fqCQdRCXkhZl0XWou0TF.V0JbeK7LIxDmtBLAw1298E01GNEjXj dSEUkoFCfal99xs7m8jI5zAVK.fH6RbIXZdqZFqJIxXKrCozFZONTLYe4kgh Cw059Y9Z.OyIeGNz2hNeJTwOOkxU6JYmMLTGdjHTUQ9Kt95A2jbFKvAFuJgO 4ngvW90.i1KUwBwmJvv1tlxmS5dwHnp9IUeGjUYyxAoZEbWiN0STzFaaQ5.0 ASOOfzlNumBhdfrOg_blwrzsKSiPKZfyZbJuhdXKCppIT39msy8.aVvT.FwQ OLevtBKjzkRf8v26lrNmf59eY5XsecBg1itFsdD4fm_1kZnKeOmfdVczj4ZH 0oSLCKGeGgxq9qG4ZeZbDUZyro4ZO_CdS3M3T5GeKvjtsppaS8Xp1RPXrQhj R1HbFCpjTLn6mm0ArVt4._v5Bz2pb2NmAZZGVtqYZRPmG8cN.7sNVhPzymCA R2l3aIINkai5l8amWC6bDiSp8Zm7YmA76b2SeEtYfnl8nPiPU9Q.lWpOHwH. dE2aHVx65jIEH4X0X7uITtAwdze2GG2YA_RhdWmI- Received: from [82.228.226.42] by web172402.mail.ir2.yahoo.com via HTTP; Tue, 19 Mar 2013 21:51:08 GMT X-Rocket-MIMEInfo: 002.001,SGkgRGVuaXMsCgpJJ3ZlIGFscmVhZHkgY2hlY2tlZCB5b3VyIHBvc3QgKHZlcnkgaW5zdHJ1Y3RpdmUsIHRoYW5rcykuwqAKSSdtIHN1cmUgU0lOR0xFX0NMQVNTTE9BREVSIGZvciBlYXIgd2lsbCByZXNvbHZlIHRoaXMgaXNzdWUuClByb2JsZW0gaXMgSSBkb24ndCBrbm93IGhvdyB0byBzcGVjaWZ5IGl0IGluIEpCb3NzIEFTIDcgKEkgZG9uJ3QgdGhpbmsgaXQncyBzdXBwb3J0ZWQgLSBKQm9zcyBhbHdheXMgY3JlYXRlcyBhbiBpc29sYXRlZCBjbGFzc2xvYWRlciBmb3IgZWFjaCB3YXIpCgpHb2luZyB0byABMAEBAQE- X-Mailer: YahooMailWebService/0.8.138.524 References: <1363707284.14033.YahooMailNeo@web172401.mail.ir2.yahoo.com> <51488FF2.5020002@curecomp.com> <1363722188.66782.YahooMailNeo@web172404.mail.ir2.yahoo.com> <5148C898.5010806@curecomp.com> <1363727772.94565.YahooMailNeo@web172401.mail.ir2.yahoo.com> Message-ID: <1363729868.72638.YahooMailNeo@web172402.mail.ir2.yahoo.com> Date: Tue, 19 Mar 2013 21:51:08 +0000 (GMT) From: Adrian Gonzalez Reply-To: Adrian Gonzalez Subject: Re: CODI ViewAccessScoped issue with EAR on JBoss 7.1.x To: MyFaces Discussion In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1916487321-437075630-1363729868=:72638" X-Virus-Checked: Checked by ClamAV on apache.org ---1916487321-437075630-1363729868=:72638 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Denis,=0A=0AI've already checked your post (very instructive, thanks).= =A0=0AI'm sure SINGLE_CLASSLOADER for ear will resolve this issue.=0AProble= m is I don't know how to specify it in JBoss AS 7 (I don't think it's suppo= rted - JBoss always creates an isolated classloader for each war)=0A=0AGoin= g to use your instructions for WAS in the future (I'm using both JBoss AS 7= and WAS 8).=A0=0AFor the moment, no problem with WAS 8 and ear packaging, = everything is under WEB-INF/lib (no EJB Timer for the moment).=0A=0ABTW, up= dated sample app (moved codi to ear) : it's in ear branch=0Ahttps://github.= com/gonzalad/codi-ear-viewaccessscoped/tree/ear=0A=0AIf I don't find a pack= aging solution, perhaps I'll give a try modifying locally CODI code, but no= t sure which approach is best (the 3rd one perhaps but not sure it will wor= k ;( ) :=0ASorry those are rough notes, and I don't master CDI :=0A=A01. mo= dify ClassUtils.getClassloader=A0=0A=A0 =A0add a configurationparameter to = return ClassUtils.class.getClassloader().=0A=A0 =A0cons : we're still relyi= ng on classloader and potentially will have a pb with another appserver.=0A= =A02. remove @JsfPhaseListener and rely on classic phaseListeners configure= d with faces-config.xml=0A=A0 =A0cons : non CDI=0A=A03. use CDI to communic= ate phaseListener class in CODI consumeJsfPhaseListener=0A=A0 =A0i.e. we co= uld perhaps add dynamically a bean or producer of type Class with a custom = annotation, i.e. @JsfPhaseListener Class.=0A=A0 =A0then in consumer, we @In= ject @JsfPhaseListener Instance jsfPhaseListenerClasses=0A=A0 =A0Aft= erwards, we instanciate phaseListener iterating on=A0jsfPhaseListenerClasse= s.iterator().=0A=A0 =A0cons : make a test with a JsfPhaseListener1 in webap= p1 and JSFPhaseListener2 in webapp2, both being in the same EAR.=0A=A0 =A0C= heck that webapp1 has only listener=A0JsfPhaseListener1=A0and not both of t= hem.=0A=0A=0A________________________________=0A De=A0: titou10 titou10 =0A=C0=A0: MyFaces Discussion ; Adrian Gonzalez =0AEnvoy=E9 le : Mardi 19 ma= rs 2013 22h37=0AObjet=A0: Re: CODI ViewAccessScoped issue with EAR on JBoss= 7.1.x=0A =0AMaybe you should check my previous post named "CODI jar in ear= /lib=0Awith a WAR =3D fail in WebSphere v8.5" and then "Does CODI supports = to=0Abe deployed in a app server that uses multi-classloader..." started=0A= January 17 because it seems that you have the same problem we have=0Awith W= ebSphere v8.5=0A=0AIf I try to deploy the CODI jar into ear/lib, some Phase= Listener=0Amagical initialisation was not working at startup (=3Dfirst page= =0Aaccessed)...=0AAnd I also have the same feeling as you that this is the = way CODI use=0Athe classloaders that causes the problem=0A...=0AThe only so= lutions we found: configure WAS to use only 1 classloader=0Afor all the mod= ules in the ear, (but this is not supported by the OWB=0Aimplementation pac= kaged with WAS), or deploy everything in war=0AWEB-INF/lib, including the e= jb jars. In fact we put "any module that=0Auses CDI (inject/producers)" in = web-inf/lib and the other in ear/lib=0A(slf4j, hibernate, jpa module etc)= =0A=0AThis is what we are doing even if I don't like it...=0A=0AMark=A0 Str= uberg answered that he was using CODI with a multi level CL=0Awithout probl= em...=0A=0A2013/3/19 Adrian Gonzalez :=0A> I've just= put myfaces-extcdi-bundle-jsf20-1.0.5.jar into ear (and removed it from WE= B-INF/lib), no more luck.=0A>=0A> I'll try to update my sample tomorrow wit= h ear packaging and debug it.=0A>=0A> Thanks once more for the help Christi= an !=0A>=0A> P.S. I'm wondering if the root cause of this bug isn't in CODI= (classloader usage in Java EE & CDI appears to be under-specified, so I'm = not sure a CDI extension should rely on TCCL for its internals)=0A>=0A>=0A>= ________________________________=0A>=A0 De : Christian Beikov =0A> =C0 : users@myfaces.apache.org=0A> Envoy=E9 le : Mardi 19 m= ars 2013 21h20=0A> Objet : Re: CODI ViewAccessScoped issue with EAR on JBos= s 7.1.x=0A>=0A> I used the xml file to be able to put the CODI bundle into = EAR/lib.=0A> The problem was that JSF is not on the classpath which the dep= loyment=0A> xml should fix.=0A> My CODI bundle is currently in EAR/lib and = it deploys successfully with=0A> this configuration.=0A>=0A> Am 19.03.2013 = 20:43, schrieb Adrian Gonzalez:=0A>> Hi Christian,=0A>>=0A>> Thanks for the= tip !=0A>>=0A>> Just made a quick test using your file with my sample, but= no luck, it doesn't work.=0A>> I'm using JBoss jsf impl (so no jsf jars in= my app).=0A>> I've also putting myfaces-extcdi-bundle-jsf20-1.0.5.jar in t= he war, WEB-INF/lib.=0A>>=0A>> Do you have the same setup ?=0A>>=0A>>=0A>> = ________________________________=0A>>=A0 De : Christian Beikov =0A>> =C0 : users@myfaces.apache.org=0A>> Envoy=E9 le : Mardi 1= 9 mars 2013 17h18=0A>> Objet : Re: CODI ViewAccessScoped issue with EAR on = JBoss 7.1.x=0A>>=0A>> Hey,=0A>>=0A>> I had the same problem a time ago. Jus= t add following jboss-deployment-structure.xml into META-INF of the EAR:=0A= >>=0A>> =0A>> =0A>>=A0 =A0 =A0 =0A>> true=0A>>=A0 =A0 =A0 =0A>>=A0 = =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0= =A0 =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 = =A0 =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 = =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0= =A0 =A0 =A0 =0A>>=A0 =A0 =A0 =A0 =A0 <= /dependencies>=0A>>=A0 =A0 =A0 =0A>> =0A>>=0A>> Am 19.03.2013 16:34, schrieb Adrian Gonzalez:=0A>>> Hello,= =0A>>>=0A>>> This is a follow up on http://mail-archives.apache.org/mod_mbo= x/myfaces-users/201212.mbox/%3C1354617133.46780.YahooMailNeo@web172404.mail= .ir2.yahoo.com%3E.=0A>>>=0A>>> @ViewAccessScoped is not working when deploy= ing an EAR on JBoss 7.1.0 (tested it with 7.1.3 same result).=0A>>> If I de= ploy only a war, it works.=0A>>> Sample project is here [1].=0A>>>=0A>>> I = used the debugguer and found that when using and EAR :=0A>>>=A0 =A0 * the = classloader obtained in PhaseListenerExtension#addPhaseListener is the EAR = classloader=0A>>>=A0 =A0 =A0 =A0 ModuleClassLoader for Module "deployment.v= iewaccessscoped-ear.ear:main" from Service Module Loader=0A>>>=A0 =A0 * th= e classloader obtained in consumePhaseListeners#consumePhaseListeners() is = the WAR classloader=0A>>>=A0 =A0 =A0 =A0 ModuleClassLoader for Module "depl= oyment.viewaccessscoped-ear.ear.viewaccessscoped-web.war:main" from Service= Module Loader=0A>>>=0A>>> This means that phaselisteners annotated with @J= sfPhaseListener are not executed.=0A>>>=0A>>> The following phaselisteners = are not registered with the war classloader when using an EAR :=0A>>>=A0 = =A0 * class org.apache.myfaces.extensions.cdi.jsf.impl.config.view.PhasesL= ifecycleCallbackPhaseListener=0A>>>=A0 =A0 * class org.apache.myfaces.exte= nsions.cdi.jsf.impl.listener.phase.JsfRequestLifecyclePhaseListener=0A>>>= =0A>>> Thanks for the help !=0A>>>=0A>>> [1] Sample project here : https://= github.com/gonzalad/codi-ear-viewaccessscoped=0A>>> To reproduce it,=0A>>> = 1. Testing the war=0A>>>=A0 =A0 =A0 a. add the war on JBoss=0A>>>=A0 =A0 = =A0 b. http://localhost:8080/viewaccessscoped-web/test.faces=0A>>>=A0 =A0 = =A0 =A0 =A0 you'll see on sysout that CODI ViewAccessScoped bean has been i= nstantiated=0A>>>=A0 =A0 =A0 =A0 =A0 16:24:52,778 INFO=A0 [stdout] (http--0= .0.0.0-8080-1) @PostConstruct=0A>>>=A0 =A0 =A0 c. click on first link.=0A>= >>=A0 =A0 =A0 =A0 =A0 you should see nothing on sysout (this means the prev= ious bean instance is reused)=0A>>> 1. Testing the ear - incorrect behaviou= r=0A>>>=A0 =A0 =A0 a. add the ear on JBoss (remove the previous war)=0A>>>= =A0 =A0 =A0 b. http://localhost:8080/viewaccessscoped-web/test.faces=0A>>>= =A0 =A0 =A0 =A0 =A0 you'll see on sysout that CODI ViewAccessScoped bean ha= s been instantiated=0A>>>=A0 =A0 =A0 =A0 =A0 16:22:49,186 INFO=A0 [stdout] = (http--0.0.0.0-8080-1) @PostConstruct=0A>>>=A0 =A0 =A0 c. click on first l= ink.=0A>>>=A0 =A0 =A0 =A0 =A0 you'll see on sysout that previous CODI ViewA= ccessScoped instance has been destroyed and a new one is created.=0A>>>=A0 = =A0 =A0 =A0 =A0 16:23:24,389 INFO=A0 [stdout] (http--0.0.0.0-8080-1) @PreDe= stroy=0A>>>=A0 =A0 =A0 =A0 =A0 16:23:24,389 INFO=A0 [stdout] (http--0.0.0.0= -8080-1) @PostConstruct=0A>>> ---1916487321-437075630-1363729868=:72638--