myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Maier (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Updated] (EXTVAL-150) Extval does not work with new placeholder component of Richfaces
Date Tue, 05 Feb 2013 07:52:12 GMT

     [ https://issues.apache.org/jira/browse/EXTVAL-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Maier updated EXTVAL-150:
--------------------------------

    Status: Patch Available  (was: Open)
    
> Extval does not work with new placeholder component of Richfaces
> ----------------------------------------------------------------
>
>                 Key: EXTVAL-150
>                 URL: https://issues.apache.org/jira/browse/EXTVAL-150
>             Project: MyFaces Extensions Validator
>          Issue Type: Bug
>    Affects Versions: 2.0.6
>         Environment: Java 7, Tomcat 7, Richfaces 4.3.0.Final, MyFaces 2.1.10
>            Reporter: Martin Maier
>         Attachments: ExtValGenericRendererWrapper.diff
>
>
> The class ExtValGenericRendererWrapper intercepts several methods of Render classes based
on reflection. This can cause problems if a Render class has a method with an equal name but
different parameter count.
> For instance: Richfaces 4.3 introduces a new class PlaceholderRendererBase with a method
'getConvertedValue' that takes 2 parameters. This method is not related to 'getConvertedValue'
of javax.faces.render.Render with 3 parameters. However, this method gets also intercepted
because the parameter count is not checked.
> The relavant code part of ExtValGenericRendererWrapper is this (line 56):
> {code}
>         if (method.getName().equals("getConvertedValue") && args[1] instanceof
UIComponent) {
>             return getConvertedValue((FacesContext) args[0], (UIComponent) args[1], args[2]);
> {code}
> which should be fixed with something like
> {code}
>         if (method.getName().equals("getConvertedValue") && args[1] instanceof
UIComponent && 
>             && method.getParameterTypes().length == 3) {
>             return getConvertedValue((FacesContext) args[0], (UIComponent) args[1], args[2]);
> {code}
> I can provide a stacktrace for this problem with the Richfaces placeholder component:
> {code}
> java.lang.IllegalStateException: Rendering of placeholder before its parent has failed
> 	at org.richfaces.component.AbstractPlaceholder$PlaceholderParentPreRenderListener.preRenderParent(AbstractPlaceholder.java:138)
> 	at org.richfaces.component.event.PreRenderParentListener.processEvent(PreRenderParentListener.java:70)
> 	at javax.faces.component.UIComponent$EventListenerWrapper.processEvent(UIComponent.java:1565)
> 	at javax.faces.event.SystemEvent.processListener(SystemEvent.java:43)
> 	at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2410)
> 	at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:577)
> 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:580)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:517)
> 	at org.apache.myfaces.shared.renderkit.RendererUtils.renderChildren(RendererUtils.java:693)
> 	at org.apache.myfaces.shared.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:115)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:77)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:359)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:66)
> 	at org.apache.myfaces.renderkit.html.HtmlGroupRenderer$$EnhancerByCGLIB$$e84eb129.encodeEnd(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer.encodeEnd(HtmlCompositeComponentRenderer.java:71)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:77)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:359)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:66)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer$$EnhancerByCGLIB$$86055b2c.encodeEnd(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
> 	at org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:276)
> 	at org.richfaces.renderkit.AbstractTableBaseRenderer.encodeColumn(AbstractTableBaseRenderer.java:82)
> 	at org.richfaces.renderkit.ColumnGroupRenderer.encodeRow(ColumnGroupRenderer.java:55)
> 	at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:80)
> 	at org.richfaces.component.AbstractColumnGroup.walk(AbstractColumnGroup.java:64)
> 	at org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:90)
> 	at org.richfaces.renderkit.AbstractRowsRenderer.processRows(AbstractRowsRenderer.java:103)
> 	at org.richfaces.renderkit.AbstractRowsRenderer.doEncodeChildren(AbstractRowsRenderer.java:120)
> 	at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:157)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeChildren(ExtValLazyRendererProxy.java:70)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeChildren(ExtValRendererWrapper.java:286)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:64)
> 	at org.richfaces.renderkit.ColumnGroupRenderer$$EnhancerByCGLIB$$7a19532d.encodeChildren(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:634)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:532)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer.encodeEnd(HtmlCompositeComponentRenderer.java:71)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:77)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:359)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:66)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer$$EnhancerByCGLIB$$86055b2c.encodeEnd(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
> 	at org.richfaces.renderkit.AbstractTableRenderer.encodeTableFacet(AbstractTableRenderer.java:533)
> 	at org.richfaces.renderkit.AbstractTableRenderer.encodeHeaderFacet(AbstractTableRenderer.java:400)
> 	at org.richfaces.renderkit.AbstractTableRenderer.encodeTableFacets(AbstractTableRenderer.java:122)
> 	at org.richfaces.renderkit.DataTableRenderer.doEncodeBegin(DataTableRenderer.java:303)
> 	at org.richfaces.renderkit.RendererBase.encodeBegin(RendererBase.java:115)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeBegin(ExtValLazyRendererProxy.java:63)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeBegin(ExtValRendererWrapper.java:213)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:62)
> 	at org.richfaces.renderkit.DataTableRenderer$$EnhancerByCGLIB$$fc1843e8.encodeBegin(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:587)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:517)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer.encodeEnd(HtmlCompositeComponentRenderer.java:71)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:77)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:359)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:66)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer$$EnhancerByCGLIB$$86055b2c.encodeEnd(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer.encodeEnd(HtmlCompositeComponentRenderer.java:71)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValLazyRendererProxy.encodeEnd(ExtValLazyRendererProxy.java:77)
> 	at org.apache.myfaces.extensions.validator.core.renderkit.ExtValRendererWrapper.encodeEnd(ExtValRendererWrapper.java:359)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:66)
> 	at org.apache.myfaces.renderkit.html.HtmlCompositeComponentRenderer$$EnhancerByCGLIB$$86055b2c.encodeEnd(<generated>)
> 	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:665)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:545)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:541)
> 	at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.renderView(FaceletViewDeclarationLanguage.java:1981)
> 	at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:285)
> 	at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:59)
> 	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:116)
> 	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:241)
> 	at org.apache.myfaces.extensions.validator.core.startup.ExtValLifecycleWrapper.render(ExtValLifecycleWrapper.java:79)
> 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:199)
> (rest skipped)
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:58)
> 	at org.richfaces.renderkit.html.PlaceholderRenderer.doEncodeEnd(PlaceholderRenderer.java:77)
> 	at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
> 	at org.apache.myfaces.extensions.validator.generic.renderkit.ExtValGenericRendererWrapper.intercept(ExtValGenericRendererWrapper.java:80)
> 	at org.richfaces.component.AbstractPlaceholder$PlaceholderParentPreRenderListener.preRenderParent(AbstractPlaceholder.java:135)
> 	... 138 more
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message