Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 156EADF4D for ; Thu, 6 Dec 2012 09:47:11 +0000 (UTC) Received: (qmail 54540 invoked by uid 500); 6 Dec 2012 09:47:10 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 54227 invoked by uid 500); 6 Dec 2012 09:47:09 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 54209 invoked by uid 99); 6 Dec 2012 09:47:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 09:47:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gerhard.petracek@gmail.com designates 209.85.212.51 as permitted sender) Received: from [209.85.212.51] (HELO mail-vb0-f51.google.com) (209.85.212.51) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 09:47:04 +0000 Received: by mail-vb0-f51.google.com with SMTP id fq11so5844128vbb.10 for ; Thu, 06 Dec 2012 01:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=4IcfxBsdAB58nANaM0Q9D4DCISCHuTucr9cKQp+InCY=; b=XW4ojqALWtpF7v2DUS03ywAb1T3nAReH9An5+YbSNWn7cJwWZPaeydoCMFlw0Gh0gl TYUGMOxggWnQHCFwVDFiXPArqWgU/2S4XXx45R5d1o+csKmkevrLe92tnWZrVm6LnSgB Y/86Zd92Gk7oCdLNutb14z3CC7MKPivu4GqiWp6Y1nENZ+tVLEMeg5MtVaoaAbkbg5rK Nowaor1cUSOS8SH5XSKI8BvzUUEXCrvGzS9FpR1TI8FVN5e7lHOmZgqeWAk8Ga2uMrvt /kkBghNIDBsLkPXtUvdtTZnathixmJpDwbE+ixFqbOrdmLiuqHpZuS/26gO9GBViF54a bG3Q== Received: by 10.52.65.209 with SMTP id z17mr474191vds.3.1354787203009; Thu, 06 Dec 2012 01:46:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.67.51 with HTTP; Thu, 6 Dec 2012 01:46:22 -0800 (PST) In-Reply-To: References: From: Gerhard Petracek Date: Thu, 6 Dec 2012 10:46:22 +0100 Message-ID: Subject: Re: Regression between myfaces-extval-core and primefaces: System-Event-Listeners are called too late. To: MyFaces Development Content-Type: multipart/alternative; boundary=20cf307d01e8fb4d0904d02bf91d X-Virus-Checked: Checked by ClamAV on apache.org --20cf307d01e8fb4d0904d02bf91d Content-Type: text/plain; charset=ISO-8859-1 hi heiko, it would be great if you can provide a link to a small example which illustrates the issue. regards, gerhard http://www.irian.at Your JSF/JavaEE powerhouse - JavaEE Consulting, Development and Courses in English and German Professional Support for Apache MyFaces 2012/12/6 > > Hello, > > We have come across an issue that occurs in the combination of > myfaces-extval and primefaces. > > We use the following configuration: > > myfaces-extcdi-bundle-jsf20 (1.0.6) > myfaces-extval-core (2.0.6) > myfaces-extval-bean-validation (2.0.6) > myfaces-extval-property-validation (2.0.6) > primefaces-3.5 (*revision 8433* > ) > > The new primefaces uses a JSF System-Event-Listener to register a widget > builder in the context. > > > javax.faces.component.UIViewRoot > > javax.faces.event.PreRenderViewEvent > > org.primefaces.webapp.PreRenderViewListener > > > with the following content: > > public class PreRenderViewListener implements SystemEventListener { > public boolean isListenerForSource(Object source) { > return true; > } > > public void processEvent(SystemEvent event) throws > AbortProcessingException { > > FacesContext.getCurrentInstance().getAttributes().put(Constants.WIDGET_BUILDER_ATTR, > new WidgetBuilder()); > } > } > > However, this system event listener seems to be called too late, as the > ExtValLazyRendererProxy tries to encode components first. This leads to an > exception at application start: > > java.lang.NullPointerException > at > org.primefaces.component.dialog.DialogRenderer.encodeScript(DialogRenderer.java:51) > at > org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.java:43) > at > org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:76) > at > org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:358) > at > javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:535) > at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626) > at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622) > at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622) > at > org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1320) > at > org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263) > at > javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59) > at > javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59) > at > org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:85) > > Primefaces rejected this an an error in their code. Is there a way that > within myfaces-extval-core, it can be made sure that system event listeners > are called before the lazy renderer starts its work? > > Thank you very much for your help, > > Best regards, > > Heiko > > If you are not the intended addressee, please inform us immediately that > you have received this e-mail in error, and delete it. We thank you for > your cooperation. > --20cf307d01e8fb4d0904d02bf91d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
hi heiko,

it would be great if you can provid= e a link to a small example which illustrates the issue.

regards,
gerhard

http://www.irian.at

Your JSF/JavaEE powerhouse -
JavaEE Consulting, Development and
C= ourses in English and German

Professional Support for Apache MyFaces=



2012/12/6 <it-media.kopp@daiml= er.com>

Hello,

We have come across an issue that occurs in the combination of myfaces-extval and primefaces.

We use the following configuration:

myfaces-extcdi-bundle-jsf20 (1.0.6)
myfaces-extval-core (2= .0.6)
myfaces-extval-bean-validation (2.0.6)
myfaces-extval-property-validatio= n (2.0.6)
primefaces-3.5 (
revision 8433)

The new primefaces uses a JSF System-Event-Listener to register a widget builder in the context.

<system-event-listener>
=A0 =A0 <source-class>javax.f= aces.component.UIViewRoot</source-class>
=A0 =A0 <system-event-= class>javax.faces.event.PreRenderViewEvent</system-event-class> =A0 =A0 <system-event-listener-class>org.primefaces.webapp.PreRenderV= iewListener</system-event-listener-class>
</system-event-listen= er>


with the following content:

public class PreRenderViewListener implements SystemEventListener {
=A0 =A0 public bo= olean isListenerForSource(Object source) {
=A0 =A0 =A0 =A0 return true;<= /font>
=A0 =A0 }

=A0 =A0 public void processEvent(SystemEvent event) throws AbortProcessingException {
=A0 =A0 =A0 =A0 FacesContext.getCurrentInstance().getAttributes().put(Con= stants.WIDGET_BUILDER_ATTR, new WidgetBuilder());
=A0 =A0 }<= br>}

Howe= ver, this system event listener seems to be called too late, as the ExtValLazyRendererProxy tries to encode components first. This leads to an exception at application start:
java.lang.NullPointerException
at org.primefa= ces.component.dialog.DialogRenderer.encodeScript(DialogRenderer.java:51) at org.primefaces.component.dialog.DialogRenderer.encodeEnd(DialogRenderer.= java:43)
at org.apache.myfaces.extensions.validator.core.renderkit.ExtVa= lLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:76)
at org.apa= che.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encod= eEnd(ExtValRendererWrapper.java:358)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:535= )
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:626)at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:622)
at = org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(= FaceletViewDeclarationLanguage.java:1320)
at org.apache.myfaces.applicat= ion.ViewHandlerImpl.renderView(ViewHandlerImpl.java:263)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper= .java:59)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewH= andlerWrapper.java:59)
at org.apache.myfaces.lifecycle.RenderResponseExe= cutor.execute(RenderResponseExecutor.java:85)
<= /font>

Primefaces rejected this an an error in their code. Is there a way that within myfaces-extval-core, it can be made sure that system event listeners are called before the lazy renderer starts its work?

Thank you very muc= h for your help,

Best regards,

Heiko

If you are not the intended addressee, please inform us immediately that yo= u have received this e-mail in error, and delete it. We thank you for your = cooperation.
=20 = =20

--20cf307d01e8fb4d0904d02bf91d--