Menu

#372 Dozer stops working after running for a while

open
nobody
5
2014-08-12
2012-04-18
David
No

Hi, this is the second project I have used dozer so thanks for all the good work so far.

My problem is Dozer would be working but after users have been using the application for a while, we would get a stack trace similar to the below (even though the same source/destination object types have been mapped correctly 1-2 hours earlier):

Caused by: java.lang.NoSuchMethodException: Unable to determine write method for Field: 'id' in Class: class com.mycompany.domain.Match
at org.dozer.propertydescriptor.JavaBeanPropertyDescriptor.getWriteMethod(JavaBeanPropertyDescriptor.java:47)
at org.dozer.propertydescriptor.GetterSetterPropertyDescriptor.invokeWriteMethod(GetterSetterPropertyDescriptor.java:259)

My understanding of the cause of the issue is due to JavaBeanPropertyDescriptor uses the java.beans.PropertyDescriptor to look up the read/write methods for the property. Unfortunately, SoftReferences are assigned to PropertyDescriptor.writeMethodRef. Hence, when the app starts up Dozer would work but after a while the SoftReference would get garbage collected. I have tried doubling the heap size with no joy. I have yet to try XX:SoftRefLRUPolicyMSPerMB and investigate the outcome.

However, I cannot help but think there is a better solution and may be someone else has seen this issue before or I interpret the cause of this issue incorrectly? I would really appreciate some help on this as the only sure way I can think of to fix this issue is to write the mapping code myself, something I would be extremely reluctant to do unless there is no alternative. Many thanks in advance.

Discussion


Log in to post a comment.