Hi

I have checked the problem in deep and I was not able to reproduce the
problem. The reason is view pooling algorithm saves UIViewRoot state
fully (markInitialState is set to false, and the state is used later
to clone the views), and that also includes the "binding" table for
tags, so this table should be always saved and restored correctly.
Really it is not a problem if you set EL cache mode to strict, because
if you are using view pool in that view, enable or disable EL cache
will have minimal effect.

It should be some additional not seen element that is making it fail,
or in other words, it should be a "combination" between different
things, but it is impossible to understand it without an example.

regards,

Leonardo

2014-06-12 3:38 GMT-05:00 Leonardo Uribe <lu4...@gmail.com>:
> Hi
>
> An example to reproduce it could help in this case.
>
> Leonardo.
>
> On Jun 10, 2014 11:21 PM, "l.pe...@senat.fr" <l.pe...@senat.fr> wrote:
>>
>> (republished here following the advice of Gerhard Petracek on
>> us...@deltaspike.apache.org)
>>
>> Dear all,
>>
>> I have the following NPE when view pooling is activated and
>> CACHE_EL_EXPRESSIONS is set to alwaysRecompile :
>>
>> java.lang.NullPointerException at
>> org.apache.myfaces.view.facelets.el.FaceletStateValueExpression.getValue(FaceletStateValueExpression.java:107)
>> at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:68) at
>> org.apache.el.parser.AstValue.getValue(AstValue.java:161) at
>> org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:47) at
>> org.apache.el.parser.AstNot.getValue(AstNot.java:44) at
>> org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185) at
>> org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:96)
>> at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:377)
>> at
>> javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1211)
>> at
>> javax.faces.component.UIComponentBase._isPhaseExecutable(UIComponentBase.java:2440)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1386)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at javax.faces.component.UIForm.processDecodes(UIForm.java:154) at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1401)
>> at
>> javax.faces.component.UIViewRoot._processDecodesDefault(UIViewRoot.java:1687)
>> at javax.faces.component.UIViewRoot.access$500(UIViewRoot.java:77) at
>> javax.faces.component.UIViewRoot$ApplyRequestValuesPhaseProcessor.process(UIViewRoot.java:1778)
>> at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1653) at
>> javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:869) at
>> org.apache.myfaces.lifecycle.ApplyRequestValuesExecutor.execute(ApplyRequestValuesExecutor.java:42)
>> at
>> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:196)
>> at
>> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:143)
>> at
>> org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
>> at javax.faces.lifecycle.LifecycleWrapper.execute(LifecycleWrapper.java:46)
>> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198) at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> at
>> fr.senat.faces.filters.HibernateNoCacheFilter.doFilter(HibernateNoCacheFilter.java:123)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> at
>> fr.senat.faces.filters.HibernateSessionConversationFilter.doFilter(HibernateSessionConversationFilter.java:128)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> at
>> fr.senat.faces.filters.HibernateUserFromPrincipalFilter.doFilter(HibernateUserFromPrincipalFilter.java:43)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> at
>> fr.senat.faces.filters.SessionCreationTrackingFilter.doFilter(SessionCreationTrackingFilter.java:48)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>> at
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>> at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>> at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>> at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>> at
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
>> at
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>> at
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at java.lang.Thread.run(Thread.java:744)
>>
>> This NPE occurs in the evalutation of an EL expression in a tag component
>> which is "cleanly" included. By clean, I mean it that the inclusion is
>> defined in a "normal" xhtml file, in opposition to some dynamic inclusions I
>> perform sometimes. This tag component is included in my application banner.
>> It is not rendered during login, then displayed once the user is logged.
>> This is done using standard rendered="..." attribute and did not cause a bug
>> before.
>>
>> In FaceletStateValueExpression#getWrapped(ELContext context)
>>
>>      public ValueExpression getWrapped(ELContext context)
>>     {
>>         FacesContext facesContext = (FacesContext)
>> context.getContext(FacesContext.class);
>>         if (facesContext == null)
>>         {
>>             facesContext = FacesContext.getCurrentInstance();
>>         }
>>         UIViewRoot root = facesContext.getViewRoot();
>>         FaceletState map = (FaceletState) root.getAttributes().get(
>>             ComponentSupport.FACELET_STATE_INSTANCE);
>>         return map.getBinding(uniqueId, key);
>>     }
>>
>> the map is defined but does not contained the keyed value. Thus the NPE in
>> FaceletStateValueExpression#getValue(ELContext context).
>>
>> The problem completely disappears if I switch to CACHE_EL_EXPRESSIONS =
>> strict.
>>
>> It occurs with myfaces 2.2.2 and deltaspike 0.7 and 0.8-SNAPSHOT. The
>> above stacktrace is obtained with 0.8-SNAPSHOT. I do not know if I it is a
>> MyFaces of DS bug.
>>
>> Tell me what additional information I can provide...
>>
>> Ludovic
>> |
>> | AVANT D'IMPRIMER, PENSEZ A L'ENVIRONNEMENT.
>> |
>>
>

Reply via email to