Bug 243 : java.lang.ClassCastException: com.avaje.ebean.server.transaction.WeakValueMap$WeakReferenceWithKey
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.5.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
12/03/2010
Updated 
12/03/2010
Type 
Bug
 
Attachments 
No attachments

java.lang.ClassCastException: com.avaje.ebean.server.transaction.WeakValueMap$WeakReferenceWithKey

this occurs very rarely and hard to reproduce.

 
Rob 12 Mar 22:43
Looks like

Looks like a bug in WeakValueMap when the entry is not null but the held value is null. Then the methods falls through to:

return backing.put(key, createReference(key, value));

The fix is to change this to:

backing.put(key, createReference(key, value));
return null;

Rob 12 Mar 22:47
Put fix into HEAD

Hard to confirm the fix as it relates to gc timing.

woResponse

Upload a file