You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Volker Malzahn (JIRA)" <de...@myfaces.apache.org> on 2011/03/10 16:56:00 UTC

[jira] Created: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

NPE in CoreResponseStateManager._restoreSerializedView
------------------------------------------------------

                 Key: TRINIDAD-2059
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.0.0-beta-2
         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
            Reporter: Volker Malzahn
            Priority: Blocker


When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed:

Caused by: java.lang.NullPointerException
	at java.io.StringReader.<init>(StringReader.java:33)
	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)

The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".

Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott O'Bryan updated TRINIDAD-2059:
------------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Thanks for the submission!

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>             Fix For: 2.0.0-beta-3
>
>         Attachments: CoreResponseStateManager.java
>
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005731#comment-13005731 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

Okay, yeah.  We're clearly in violation of the JSF Spec here.  In the Javadoc for ViewHandler.restorView (http://tinyurl.com/4b5p3tv) is says:

"If there is no available state for the specified viewId, return null."

I'll get to this when I can..  Of course if you're interested in submitting a patch, I may be able to apply it quicker..

Thanks for catching this..

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Volker Malzahn (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Volker Malzahn updated TRINIDAD-2059:
-------------------------------------

    Status: Patch Available  (was: Open)

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Volker Malzahn (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012533#comment-13012533 ] 

Volker Malzahn commented on TRINIDAD-2059:
------------------------------------------

Is it possible to include the attached patch and make a version 2.0.0-beta-3 soon? I'm wating for a version containing this path.

Regards,
Volker

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>             Fix For: 2.0.0-beta-3
>
>         Attachments: CoreResponseStateManager.java
>
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018924#comment-13018924 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

BTW- In the future, it helps if you commit "patch" files.  They are easier to merge and easier to see the changes.


> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>             Fix For: 2.0.0-beta-3
>
>         Attachments: CoreResponseStateManager.java
>
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005185#comment-13005185 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

I guess my question is, why isn't the swf preserving the ViewState.  Seems to me to be something fairly central to JSF and they should have a way of preserving it.

That said, I'm sure there are ways Trinidad can try to simply restore the last populated state, but there would be implications on window detection and the like which would all need to be worked out.

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Priority: Blocker
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018923#comment-13018923 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

I'm going to be committing this today Volker and it should be available in our initial release.  Sorry it took so long for me to get back to you.  It's been crazy.. 

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Assignee: Scott O'Bryan
>             Fix For: 2.0.0-beta-3
>
>         Attachments: CoreResponseStateManager.java
>
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005195#comment-13005195 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

Okay, thinking about this issue more, in response to a 'GET' Request, I believe that JSF typically executes a createView instead of a restore view.  I think in order to properly restore a view, you need to have your view state.  I'm curious, therefore, why spring is trying to execute a restore view unless it's somehow trying to "trick" the framework into thinking that this is a postback.

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>            Priority: Blocker
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Volker Malzahn (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005698#comment-13005698 ] 

Volker Malzahn commented on TRINIDAD-2059:
------------------------------------------

"redirect after post" is standard behaviour when using SWF. It's not wise to run without "redirect after post" because then you run into the "reload button issue". In any case it should make sense (and not much effort) to make the method _restoreSerializedView null save respective the stateString (simply returning null if stateString is null). This would tell SWF that the view can't be restored and thus a createView is triggered.

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (TRINIDAD-2059) NPE in CoreResponseStateManager._restoreSerializedView

Posted by "Scott O'Bryan (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005727#comment-13005727 ] 

Scott O'Bryan commented on TRINIDAD-2059:
-----------------------------------------

I agree that "redirect after post" is a standard behavior for SWF, but SWF itself is not a standard.

That said, if all that needs to happen is for us to return a null, I have no issues with it.  Let me do some consultation of the spec for JSF and see if we're violating the contract there somewhere.  I can't imagine a NullPointerException is an acceptable exception to throw..  If it is, however, then likely we'll need to open this up to the Trinidad list to get some comments.

> NPE in CoreResponseStateManager._restoreSerializedView
> ------------------------------------------------------
>
>                 Key: TRINIDAD-2059
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2059
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: WinXP, IE 8, Firefox 3.6, Tomcat 5.5, Spring Web Flow 2.3.0, Mojarra 2.0.2-FCS
>            Reporter: Volker Malzahn
>
> When Trinidad runs inside Mojarra and Sping Web Flow (SWF) a Nullpointerexception occurs when the "redirect after post" GET request is executed for a postBack:
> Caused by: java.lang.NullPointerException
> 	at java.io.StringReader.<init>(StringReader.java:33)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager._restoreSerializedView(CoreResponseStateManager.java:279)
> 	at org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager.getTreeStructureToRestore(CoreResponseStateManager.java:146)
> 	at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:584)
> 	at org.springframework.faces.webflow.FlowViewStateManager.restoreView(FlowViewStateManager.java:195)
> 	at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
> 	at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
> 	at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
> 	at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:242)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreFlowView(FlowViewHandler.java:144)
> 	at org.springframework.faces.webflow.FlowViewHandler.restoreView(FlowViewHandler.java:83)
> 	at org.springframework.faces.webflow.JsfViewFactory.getView(JsfViewFactory.java:105)
> 	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:193)
> 	at org.springframework.webflow.engine.Flow.resume(Flow.java:545)
> The reason is that in "String stateString = _getStateString(external);" null is returned (because the GET request of SWF doesn't contain the request parameter "javax.faces.ViewState").
> CoreResponseStateManager._restoreSerializedView should become null save by putting a "if (stateString != null) {" before the "StringReader sr = new StringReader(stateString);".
> Is it possible to restore the view if we don't have a request parameter "javax.faces.ViewState" so that the component tree doesn't need to be built again in the GET request when emedded into SWF?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira