But if it is null then you could have a problem that things should be
versioned but arent..

So adding null checks is not the fix.

johan


On 3/2/07, Aaron HIniker <[EMAIL PROTECTED]> wrote:

 That's why I was pointing at mayTrackChangesFor()..  I looked at the
method and I can't see a loophole, but there must be one to generate an NPE,
correct?

When I implemented the not-null check, I noticed exceptions still being
thrown from 2 other methods (if you search Page.java for versionManager,
you can see where there is the assumption that mayTrackChangesFor() is
checked for 'true', yet versionManager is never initialized in other methods
as well.  So after adding the null check to each of these methods, the
application is working fine.  Thing is, I've only seen this exception when
dealing with ajax (default not versioned, right?).

I will try and run a debugger through mayTrackChangesFor() with my current
app, and see the logic flow and why versionManager is ending up null.

Aaron

Johan Compagner wrote:

That is because the mayTrackChangesFor() method should only return true
when it makes a version manager. Why is that not the case?
If that method returns true the version manager can't be null because the
version info must be tracked.

johan


On 3/1/07, Aaron Hiniker <[EMAIL PROTECTED]> wrote:
>
> I pulled the latest from trunk.  And I am getting this NPE:
>
> 16:30:14,543 ERROR [STDERR] java.lang.NullPointerException
> 16:30:14,544 ERROR [STDERR]     at
> wicket.Page.componentStateChanging(Page.java:327)
> 16:30:14,545 ERROR [STDERR]     at
> wicket.Component.addStateChange(Component.java:2553)
> 16:30:14,545 ERROR [STDERR]     at
> wicket.Component.setModel(Component.java:2191)
> 16:30:14,545 ERROR [STDERR]     at
> wicket.MarkupContainer.setModel(MarkupContainer.java :596)
> 16:30:14,546 ERROR [STDERR]     at
> com.edicorp.erp.web.components.search.ProductSearchPanel.query(
> ProductSearchPanel.java:144)
> 16:30:14,546 ERROR [STDERR]     at
> com.edicorp.erp.web.components.search.ProductSearchPanel.onUpdate (
> ProductSearchPanel.java:109)
> 16:30:14,546 ERROR [STDERR]     at
> com.edicorp.erp.web.components.search.FilterPanel.fireOnChange(
> FilterPanel.java:74)
> 16:30:14,547 ERROR [STDERR]     at
>
> com.edicorp.erp.web.components.search.query.QueryPanel$QueryForm.onSubmit(
> QueryPanel.java:197)
> 16:30:14,547 ERROR [STDERR]     at
> wicket.markup.html.form.Form.delegateSubmit(Form.java:680)
> 16:30:14,547 ERROR [STDERR]     at
> wicket.markup.html.form.Form.onFormSubmitted(Form.java:396)
> 16:30:14,547 ERROR [STDERR]     at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>
> I remember I was getting this NPE before, and I patched the source to
> include this null check in Page.java :
>
>         final void componentStateChanging(final Component component,
> Change change)
>         {
>                 checkHierarchyChange(component);
>
>                 dirty();
>                 if (mayTrackChangesFor(component, null))
>                 {
>                         if ( versionManager != null )
>
> versionManager.componentStateChanging(change);
>                 }
>         }
>
> It seems that everywhere else in Page.java there is a null check for
> versionManager, except in this method.  Not sure, but perhaps the
> problem lies in the #mayTrackChangesFor() method, but in any case if I
> add this null check my code runs fine.
>
> Aaron
>
>
> -------------------------------------------------------------------------
>
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

------------------------------

_______________________________________________
Wicket-user mailing list
[EMAIL PROTECTED]://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to