You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Anton Zukovskij (JIRA)" <de...@myfaces.apache.org> on 2012/08/23 20:38:42 UTC

[jira] [Created] (MYFACES-3596) NPE exception is thrown during ajax requests from webflow

Anton Zukovskij created MYFACES-3596:
----------------------------------------

             Summary: NPE exception is thrown during ajax requests from webflow
                 Key: MYFACES-3596
                 URL: https://issues.apache.org/jira/browse/MYFACES-3596
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.1.8
         Environment: myfaces-2.1.8 + richfaces-4.2.2 + webflow-2.3.1
            Reporter: Anton Zukovskij


When using a4j:commanButton from webflow rendered view NullPointerException is thrown during restoreState of component (state==null). Changing to mojarra implementation solves this problem, therefore it is myfaces integration issue. Please see sample webapp and logs attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3596) NPE exception is thrown during ajax requests from webflow

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440827#comment-13440827 ] 

Leonardo Uribe commented on MYFACES-3596:
-----------------------------------------

I checked the patch and I was able to reproduce the problem, thanks for the example.

I checked the implementation of FlowViewStateManager, and this class has JSF 1.1/1.2 in mind, so if you set  javax.faces.PARTIAL_STATE_SAVING config param to false, the code will work as expected.

The problem is caused because MyFaces has a very optimized algorithm in PSS, that in some cases generates zero state per view. So, it is possible to set a view as valid, but return null in the state.

In few words, FlowViewStateManager relies on the old behavior. To implement Partial State Saving in JSF 2.0, some changes were done. After a lot of investigation, the right thing to do it is provide a custom org.apache.myfaces.application.StateCache, overriding it org.apache.myfaces.renderkit.html.HtmlResponseStateManager . In that way, it is possible to override the logic involved in store the state (in this case store it into spring view scope). In this way, PSS logic is preserved.

This is not a MyFaces issue, instead it is a problem that should be solved from Spring side. I'll close this issue as invalid, because it works with PSS disabled, and we cannot do anything from MyFaces side. This problem will be fixed in JSF 2.2, with the introduction of windowId concept, and the integration of such logic into state saving algorithm.
                
> NPE exception is thrown during ajax requests from webflow
> ---------------------------------------------------------
>
>                 Key: MYFACES-3596
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3596
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.1.8
>         Environment: myfaces-2.1.8 + richfaces-4.2.2 + webflow-2.3.1
>            Reporter: Anton Zukovskij
>         Attachments: log.log, swf-rf4.zip
>
>
> When using a4j:commanButton from webflow rendered view NullPointerException is thrown during restoreState of component (state==null). Changing to mojarra implementation solves this problem, therefore it is myfaces integration issue. Please see sample webapp and logs attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3596) NPE exception is thrown during ajax requests from webflow

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-3596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13440831#comment-13440831 ] 

Leonardo Uribe commented on MYFACES-3596:
-----------------------------------------

Related spring webflow issue is https://jira.springsource.org/browse/SWF-1540
                
> NPE exception is thrown during ajax requests from webflow
> ---------------------------------------------------------
>
>                 Key: MYFACES-3596
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3596
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.1.8
>         Environment: myfaces-2.1.8 + richfaces-4.2.2 + webflow-2.3.1
>            Reporter: Anton Zukovskij
>            Assignee: Leonardo Uribe
>         Attachments: log.log, swf-rf4.zip
>
>
> When using a4j:commanButton from webflow rendered view NullPointerException is thrown during restoreState of component (state==null). Changing to mojarra implementation solves this problem, therefore it is myfaces integration issue. Please see sample webapp and logs attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira