Since Dozer4.3 dozer does not find classes in the context classloader, so
that we get net.sf.dozer.util.mapping.MappingException:
java.lang.ClassNotFoundException
when mapping classes located in the .war archive (dozer.jar is located in
the parent classloader, e.g. in the lib directory of the appserver).
This worked correctly in previous versions of dozer, because it used the
ContextClassLoader.
Class MappingUtils has been changed in Dozer4.3 (ff.) so that dozer only
finds classes that are in the same classload as dozer itself:
New Code (since 4.3)
public static Class loadClass(String name) {
Class result = null;
try {
result = Class.forName(name);
} catch (ClassNotFoundException e) {
MappingUtils.throwMappingException(e);
}
return result;
}
I suggest, that you revert the change and use the former code again, that
fixes the bug:
Code in Dozer4.2 and before:
public static Class loadClass(String name) {
Class result = null;
try {
result =
Thread.currentThread().getContextClassLoader().loadClass(name);
} catch (ClassNotFoundException e) {
MappingUtils.throwMappingException(e);
}
return result;
}
Best regards,
Roman Stumm
Nobody/Anonymous
None
Dozer v4.4.1
Public
|
Date: 2009-01-10 14:45 Fixed, included in 4.4.1 release |
|
Date: 2009-01-05 12:23 Thank you for reporting this issue. |
|
Date: 2009-01-05 10:35 Another suggestion: Dozer is already using commons-lang |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-01-10 14:45 | buzdin |
| resolution_id | None | 2009-01-10 14:45 | buzdin |
| artifact_group_id | None | 2009-01-10 14:45 | buzdin |
| close_date | - | 2009-01-10 14:45 | buzdin |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use