You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org> on 2011/03/23 21:35:06 UTC

[jira] [Created] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

when trinidad on class path get NPE using html_basic render kit
---------------------------------------------------------------

                 Key: TRINIDAD-2069
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 2.0.0-beta-2
            Reporter: Gabrielle Crawford
            Assignee: Gabrielle Crawford


Trinidad is on the class path, but using html_basic renderkit.

When doing a postback we get

java.lang.NullPointerException
at
javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
at
com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

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

[jira] [Updated] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford updated TRINIDAD-2069:
-----------------------------------------

    Status: Patch Available  (was: Reopened)
    
> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>             Fix For: 2.0.0-core
>
>         Attachments: trin2069.patch
>
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

--
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] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford commented on TRINIDAD-2069:
----------------------------------------------

 this is the code that is getting the NPE:
    protected Renderer getRenderer(FacesContext context) {

        String rendererType = getRendererType();
        Renderer result = null;
        if (rendererType != null) {
            result = context.getRenderKit().getRenderer(getFamily(),
                    rendererType);

getRenderKit() returns NULL, 

That's because null is returned from javax.faces.component.UIViewRoot in this method.
    /**
     * <p>Return the render kit identifier of the {@link
     * javax.faces.render.RenderKit} associated with this view.  Unless
     * explicitly set, as in {@link
     * javax.faces.application.ViewHandler#createView}, the returned
     * value will be <code>null.</code></p>
     */
    public String getRenderKitId() {

        return (String) getStateHelper().eval(PropertyKeys.renderKitId);

    }


> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

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

[jira] [Commented] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford commented on TRINIDAD-2069:
----------------------------------------------

For background the renderKit id is
saved as component state on the view root, and it's not being restored during
restore view.

In org.apache.myfaces.trinidadinternal.application.StateManagerImpl.saveView
we are calling this code

      Object structure = !_needStructure(context) ? null :
               new Structure(viewRoot);
      Object state = viewRoot.processSaveState(context);
      viewState = new Object[]{structure, state};

in
org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView
we are using this code:

      structure = rsm.getTreeStructureToRestore(context, viewId);
      state = rsm.getComponentStateToRestore(context);

Normally when you run trin/rich client the responseStateManager used is
org.apache.myfaces.trinidadinternal.renderkit.core.CoreResponseStateManager,
which returns a value from getComponentStateToRestore.

In the case that's failing state is null (remember that the renderKit id is
saved as component state on the view root). The reason the state is null is
that when you use the HTML_BASIC renderkit, you are not using
CoreResponseStateManager, instead you are calling getComponentStateToRestore
on javax.faces.render.ResponseStateManager, and that method returns null.

getComponentStateToRestore is a deprecated method. Changing the code in
restoreView to the following fixes the issue.

      Object[] stateArray = (Object[])rsm.getState(context, viewId);
      structure = stateArray[0];
      state = stateArray[1];

> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

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

[jira] [Reopened] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Bernd Bohmann reopened TRINIDAD-2069:
-------------------------------------


Hi Gabrielle i would prefer the patch added with 'Grant license to ASF for inclusion in ASF works' 
                
> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>             Fix For: 2.0.0-core
>
>         Attachments: trin2069.patch
>
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

--
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] [Updated] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford updated TRINIDAD-2069:
-----------------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)
    
> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>             Fix For: 2.0.0-core
>
>         Attachments: trin2069.patch, trin2069.patch
>
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

--
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] [Updated] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford updated TRINIDAD-2069:
-----------------------------------------

    Status: Patch Available  (was: Open)

> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

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

[jira] [Updated] (TRINIDAD-2069) when trinidad on class path get NPE using html_basic render kit

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

Gabrielle Crawford updated TRINIDAD-2069:
-----------------------------------------

    Status: Patch Available  (was: Open)

> when trinidad on class path get NPE using html_basic render kit
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-2069
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2069
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta-2
>            Reporter: Gabrielle Crawford
>            Assignee: Gabrielle Crawford
>
> Trinidad is on the class path, but using html_basic renderkit.
> When doing a postback we get
> java.lang.NullPointerException
> at
> javax.faces.component.UIComponentBase.getRenderer(UIComponentBase.java:1269)
> at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:789)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1048)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1043)
> at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:922)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:74)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
> at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)

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