I was testing the newest release this morning, and found a problem related to classloader.
As explained in the thread called "Dozer suggestions", i want to put common jars not in my WEB-INF/lib, but in another simple project (added to ws.ext.dirs). When i map 'simple' objects (with simple-type fields: String, int, ...), it works fine. But i have a more complex case that doesn't work :
Consider a A class with a field named foo, of AFoo type.
Consider a APrime class with a field named foo, of AFooPrime type.
Here's my mapping :
In this case, i get the following error message (printStackTrace()) :
org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: net.sf.dozer.util.mapping.fieldmap.FieldMap
Now, i change my mapping to :
As you can see, foo fields aren't mapped at all. But this doesn't make any error at runtime ...
To solve that, i made a few changes in Dozer sources :
In MappingFileReader.java, line 126, change :
FieldMap fm = (FieldMap) SerializationUtils.clone(field);
FieldMap fm = (FieldMap) field.clone();
I have also changed Hint.java, Field.java and FieldMap.java to make them Cloneable. clone() methods are all like :
public Object clone() throws
1. It works !! (of course ;-) )
2. It's quicker like the former code. With this example, on a 1000 iterations loop, it's between 1.5 and 2 times faster.
Ready for the next release ? ;-)
Thanks for the suggestions, we will test them out.
You sure you don't want to be on the dozer team :) ?
I will test and put these fixes in today for you.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.