java.lang.ClassCastException: com.avaje.ebean.server.transaction.WeakValueMap$WeakReferenceWithKey
this occurs very rarely and hard to reproduce.
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;
Hard to confirm the fix as it relates to gc timing.