[ 
https://issues.apache.org/jira/browse/MYFACES-2466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801274#action_12801274
 ] 

Jakob Korherr commented on MYFACES-2466:
----------------------------------------

So, I finally found the problem:

The problem is that _systemEventListenerClassMap is saved and restored in the 
same way as _behaviorsMap, but _systemEventListenerClassMap is not recreated 
via the view declaration language like _behaviorsMap, because the listeners 
were added programatically via UIComponent.subscribeToEvent(). So there is no 
Map instance and there are no _DeltaList instances to which the delta state 
could be applied.

However, I do not know if this already is the right behavior? Are 
SystemEventListeners on UIComponents only allowed to be applied via the VDL? 
This would change things...

> NullPointerException in 
> UIComponentBase.restoreDeltaSystemEventListenerClassMap() when UIViewRoot 
> subscribed to PostAddToViewEvent
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MYFACES-2466
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2466
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-alpha-2
>            Reporter: Jakob Korherr
>         Attachments: exception-trigger.patch
>
>
> java.lang.NullPointerException
>       at 
> javax.faces.component.UIComponentBase.restoreDeltaSystemEventListenerClassMap(UIComponentBase.java:1770)
>       at 
> javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1611)
>       at javax.faces.component.UIViewRoot.restoreState(UIViewRoot.java:1161)
>       at 
> org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreStateFromMap(DefaultFaceletsStateManagementStrategy.java:379)
>       at 
> org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:181)
>       at 
> org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:388)
>       at 
> org.apache.myfaces.view.ViewDeclarationLanguageBase.restoreView(ViewDeclarationLanguageBase.java:106)
>       at 
> org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.restoreView(FaceletViewDeclarationLanguage.java:972)
>       at 
> org.apache.myfaces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:231)
>       at 
> org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:106)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:129)
>       at 
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:85)
>       at 
> javax.faces.webapp.FacesServlet._handleStandardRequest(FacesServlet.java:453)
>       ... 13 more
> In this scenario savedObject is an instance of _AttachedDeltaWrapper, but 
> _systemEventListenerClassMap is empty and so it returns null for 
> get(entry.getKey()). Thus a NullPointerException is thrown in the following 
> line (UIComponentBase.java:1770).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to