You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Tim (JIRA)" <de...@myfaces.apache.org> on 2006/08/31 06:57:23 UTC

[jira] Created: (TOMAHAWK-644) Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.

Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.
--------------------------------------------------------------------------------------------------

                 Key: TOMAHAWK-644
                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-644
             Project: MyFaces Tomahawk
          Issue Type: Bug
    Affects Versions: 1.1.4-SNAPSHOT
            Reporter: Tim


AutoScrollPhaseListener test if the viewId is null

....
        String viewId = facesContext.getViewRoot().getViewId();
        if (viewId != null)
        {
.....

However when using weblets and a non jsf call comes in the view root is null and a warning gets printed:

WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@ae18dd) threw exception: java.lang.NullPointerException null
org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:274)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)

The fix is to check if the viewroot is null also

        String viewId = facesContext.getViewRoot().getViewId();
        if (viewId != null)
        {


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-644) Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.

Posted by "Tim (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-644?page=comments#action_12431782 ] 
            
Tim commented on TOMAHAWK-644:
------------------------------

The last bit could be:

        String viewId = null;

        if (facesContext.getViewRoot() != null)
             viewId = facesContext.getViewId();
        }

        if (viewId != null)
        { 



Now the problem only occurs on non-jsf requests (such as javascript, css, etc) so everything continues as normal.

> Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.
> --------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-644
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-644
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.4-SNAPSHOT
>            Reporter: Tim
>
> AutoScrollPhaseListener test if the viewId is null
> ....
>         String viewId = facesContext.getViewRoot().getViewId();
>         if (viewId != null)
>         {
> .....
> However when using weblets and a non jsf call comes in the view root is null and a warning gets printed:
> WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@ae18dd) threw exception: java.lang.NullPointerException null
> org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:274)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
> The fix is to check if the viewroot is null also
>         String viewId = facesContext.getViewRoot().getViewId();
>         if (viewId != null)
>         {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-644) Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.

Posted by "Tim (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-644?page=comments#action_12431783 ] 
            
Tim commented on TOMAHAWK-644:
------------------------------

Kill me, oh for an edit button.

Anyways. lets try:

       String viewId = null;

        if (facesContext.getViewRoot() != null)
             viewId = facesContext.getViewRoot().getViewId();
        }

        if (viewId != null)
        { 

Problem then is solved.

> Nullpointer in AutoScrollerPhaseListener when using weblets and a request for a resource comes in.
> --------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-644
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-644
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.4-SNAPSHOT
>            Reporter: Tim
>
> AutoScrollPhaseListener test if the viewId is null
> ....
>         String viewId = facesContext.getViewRoot().getViewId();
>         if (viewId != null)
>         {
> .....
> However when using weblets and a non jsf call comes in the view root is null and a warning gets printed:
> WARNING: phase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@ae18dd) threw exception: java.lang.NullPointerException null
> org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:274)
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:113)
> The fix is to check if the viewroot is null also
>         String viewId = facesContext.getViewRoot().getViewId();
>         if (viewId != null)
>         {

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira