mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-30 01:58:23 +08:00
🐛 修复某些情况下会抛出CannotResolveClassException异常错误的问题
https://stackoverflow.com/questions/9508292/nodecom-thoughtworks-xstream-mapper-cannotresolveclassexception-while-using-xstr
This commit is contained in:
@ -150,6 +150,7 @@ public abstract class BaseWxPayResult {
|
|||||||
}
|
}
|
||||||
XStream xstream = XStreamInitializer.getInstance();
|
XStream xstream = XStreamInitializer.getInstance();
|
||||||
xstream.processAnnotations(clz);
|
xstream.processAnnotations(clz);
|
||||||
|
xstream.setClassLoader(BaseWxPayResult.class.getClassLoader());
|
||||||
T result = (T) xstream.fromXML(xmlString);
|
T result = (T) xstream.fromXML(xmlString);
|
||||||
result.setXmlString(xmlString);
|
result.setXmlString(xmlString);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user