I've experienced the exact same problem. You'll get this a lot when working
with ajax components. I've also reported this issue to the wicket 2 jira. If
you add if(versionManger != null) prior to the versionManager call you'll be
fine but that's probably an ugly hack. But it seem to work til they've
actually fixed it. 


Aaron Hiniker-2 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/NPE-in-Page-componentStateChanging-tf3330773.html#a9347814
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
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