You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Alexander Suslov (JIRA)" <ji...@apache.org> on 2007/09/08 08:36:29 UTC

[jira] Created: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
------------------------------------------------------------------------------------------------

                 Key: WICKET-943
                 URL: https://issues.apache.org/jira/browse/WICKET-943
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.2.6
         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
            Reporter: Alexander Suslov
            Priority: Blocker
             Fix For: 1.2.7


This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.

This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Assigned: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg reassigned WICKET-943:
------------------------------------

    Assignee: Johan Compagner

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Commented: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Matej Knopp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532131 ] 

Matej Knopp commented on WICKET-943:
------------------------------------

setRenderAllowed(isActionAuthorized(RENDER))  must be called after beforeRender(). Can't we just call setRenderAllowed(true) in component detach?

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Commented: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Alexander Suslov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532317 ] 

Alexander Suslov commented on WICKET-943:
-----------------------------------------

I think that it a logical issue and need to be fixed here (in renderComponent method by switching method call), because logic of many components is based on visibility status. If after that some components will work incorrectly, then this components need to be fixed. This problem look likes a result of some quick crunch that was made earlier.

Or this bug also can be fixed by removing check of visibility status in attach method, but this will reduce system performance.

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Commented: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532137 ] 

Johan Compagner commented on WICKET-943:
----------------------------------------

Then the are not rendered but aren't we then opening a security hole?
Because then the component is visible in the request/interface call phase so if one could guess the path it would be able to execute something right?

So then we have to quickly set it to visible before the onRender ?

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Commented: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532130 ] 

Johan Compagner commented on WICKET-943:
----------------------------------------

is this also an issue for 1.3? 

also i dont know if we can easily fix this is see comments in the code like:

	// check authorization
		// first the component itself
		// (after attach as otherwise list views etc wont work)
		setRenderAllowed();

So the component structure must be there before the setRenderedAllowed call?

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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


[jira] Closed: (WICKET-943) java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)

Posted by "Johan Compagner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Compagner closed WICKET-943.
----------------------------------

    Resolution: Fixed

we now only call isVisible() instead of isVisibleInHierarchy()
 in 1.3 we already do that

> java.lang.NullPointerException at wicket.markup.html.list.ListView.renderItem(ListView.java:676)
> ------------------------------------------------------------------------------------------------
>
>                 Key: WICKET-943
>                 URL: https://issues.apache.org/jira/browse/WICKET-943
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.2.6
>         Environment: Window XP SP3, Java 1.6, Tomcat 5.0_09
>            Reporter: Alexander Suslov
>            Assignee: Johan Compagner
>            Priority: Blocker
>             Fix For: 1.2.7
>
>
> This problem happens if parent component has been hidden by authorization strategy during the previous page render, but on the next render parent component becomes visible. This problem is common for all repeaters. The problem here is in internalOnAttach() method of repeaters. This method will not populate items if it not visible in hierarchy, but when it checks this it use old visible state (Component.FLAG_IS_RENDER_ALLOWED) of component (itself and parent components), this state is changed after setRenderAllowed() method in Component.java on 1630 line returns, but internalAttach() method is called earlier in Component.java on 1624 line. After that component become visible and will be rendered. But it can't be rendered because items were not populated, so null pointer exception occurs.
> This problem can be fixed if method calls of internalAttach() and setRenderAllowed(isActionAuthorized(RENDER)) will be swapped or logic of repeaters (ListView, DataView, etc) components will be changed.

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