[ http://issues.apache.org/jira/browse/WICKET-142?page=comments#action_12457014 ] Igor Vaynberg commented on WICKET-142: --------------------------------------
actually that class itself doesnt cause the NPE. if you look at the source code you will see that it has readobject overridden that reinitializes array_ field to a non-null value when the object is deserialized. the problem here seems to be terracotta. it looks like it doesnt replicate the transient field nor does it invoke writeobject/readobject so the field is never reinitialized. looks like we need to discuss this with terracotta guys. > NullPointerException after deserialize > wicket.util.concurrent.CopyOnWriteArrayList > ---------------------------------------------------------------------------------- > > Key: WICKET-142 > URL: http://issues.apache.org/jira/browse/WICKET-142 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 1.2.3 > Reporter: Ingram Chen > Assigned To: Igor Vaynberg > > wicket.feedback.FeedbackMessages by default using > wicket.util.concurrent.CopyOnWriteArrayList for storage. however > CopyOnWriteArrayList internally use a transient Object[] array_ without > checking null and lazy initialization. This may cause NullPointerException > after session replication or the like. Below is stack trace while testing > terracotta session clustering : > WicketMessage: unable to get object, model: > Model:classname=[wicket.feedback.FeedbackMessagesModel]:attached=true, called > with component [MarkupContainer [Component id = messages, page = > ngc.wicket.pages.MainPage , path = > 7:globalFeedback:feedbackul:messages.FeedbackPanel$MessageListView, isVisible > = true, isVersioned = false]] > Root cause: > java.lang.NullPointerException > at wicket.util.concurrent.CopyOnWriteArrayList.size > (CopyOnWriteArrayList.java:152) > at wicket.feedback.FeedbackMessages.messages(FeedbackMessages.java:258) > at > wicket.feedback.FeedbackMessagesModel.onGetObject(FeedbackMessagesModel.java:101) > at wicket.model.AbstractDetachableModel.getObject > (AbstractDetachableModel.java:104) > at wicket.Component.getModelObject(Component.java:990) > at > wicket.markup.html.panel.FeedbackPanel.updateFeedback(FeedbackPanel.java:234) > at wicket.Page$2.component (Page.java:372) > at wicket.MarkupContainer.visitChildren(MarkupContainer.java:744) > at wicket.Page.renderPage(Page.java:368) > -- 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
