[
https://issues.apache.org/jira/browse/MYFACES-4023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15167142#comment-15167142
]
Johannes Grimm commented on MYFACES-4023:
-----------------------------------------
Thank you for your feedback. With your answer I was able to fix the issue I had.
> NullPointerException accessing an attribute of a component within c:forEach
> and partial state saving activated
> --------------------------------------------------------------------------------------------------------------
>
> Key: MYFACES-4023
> URL: https://issues.apache.org/jira/browse/MYFACES-4023
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.10-SNAPSHOT
> Reporter: Johannes Grimm
> Assignee: Leonardo Uribe
> Fix For: 2.2.10
>
> Attachments: MyFaces-ForEach-PartialStateSaving.zip
>
>
> Accessing an attribute from with in a composite component that is contained
> in a forEach tag causes a null pointer exception if partial state saving is
> enabled.
> As the example is too complex to be shown within this report an example
> project can be found at
> https://github.com/jgrimmwsb/faces-foreach-partial-state-saving.
> Steps to reproduce the error:
> # Ensure the selected {{myfaces.version}} in the {{pom.xml}} is one of
> *2.2.10-SNAPSHOT*.
> # Ensure that {{javax.faces.PARTIAL_STATE_SAVING}} is set to *true* in the
> {{web.xml}}.
> # Start the application and open the respective website.
> # The log will show an exception like shown below:
> {code:title=Stacktrace}
> java.lang.NullPointerException
> at
> org.apache.myfaces.view.facelets.el.FaceletStateValueExpression.getWrapped(FaceletStateValueExpression.java:75)
> at
> org.apache.myfaces.view.facelets.el.FaceletStateValueExpression.getValue(FaceletStateValueExpression.java:107)
> at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:74)
> at
> org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
> at
> org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:96)
> at
> javax.faces.component._ComponentAttributesMap.get(_ComponentAttributesMap.java:331)
> at example.Test.getVariables(Test.java:161)
> at example.Test.captureOriginalVars(Test.java:133)
> at example.Test.visitTree(Test.java:77)
> at javax.faces.component.UIForm.visitTree(UIForm.java:345)
> at javax.faces.component.UIComponent.visitTree(UIComponent.java:1047)
> at
> javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:1191)
> {code}
> With _MyFaces 2.2.7_ or _Mojarra_ the error did not occur. _MyFaces
> 2.2.10-SNAPSHOT_ with {{javax.faces.PARTIAL_STATE_SAVING}} is set to *false*
> works without error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)