[ 
http://issues.apache.org/jira/browse/WICKET-142?page=comments#action_12457054 ] 
            
Johan Compagner commented on WICKET-142:
----------------------------------------

ahh but terracotta has to honor transient fields (don't serialize them) (else 
you can serialize everything including application and things that are not 
meant to be serialized)
But readObject should be invoked so that we can construct the object again 
right.

How does terracotta handle Hashmaps? Because that one is also depending on read 
object.

if you do this:

class-expression>wicket.util.concurrent.CopyOnWriteArrayList
</class-expression>
  <on-load>
    <execute>self.array_ = new Object[0];</execute>
  </on-load>
</include> 

then the array is initialized to be empty yes? But that is not right. that list 
is not empty.. It should have the values it had before.
I dont know why CopyOnWriteArrayList does that read/write for that array. 
Because it just seems to write out the array values
So why they are not just having that array non transient i don't know. So for 
this case i guess your transient honor setting 
for that class can be done.

But we in wicket have more code like that that is very valid to work that way. 
Like the URLCompressor class.
And i dont know how terracotta handles that but WeakReferences shouldn't be 
serialized or sent to another jvm at any time.



> 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

        

Reply via email to