[ http://issues.apache.org/jira/browse/WICKET-142?page=comments#action_12457089 ] steve harris commented on WICKET-142: -------------------------------------
HashMaps are managed Logically. Meaning the internal structure is not mapped identically between JVMs and instead the operations are recorded with the parameters and played back where needed. This is because the identiy hashcode for objects that have the same terracotta object id on one JVM will be different in a second JVM. That would lead to an incorrect internal structure. In the case of HashMaps it is also more efficient to manage it logically. Anyway, that is all a bit of an aside. The point is just that we don't have to worry about read and write object for logically managed objects. I suspect that we will make CopyOnWrite logically managed at some point as well. > 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
