🐛 修复某些情况下会抛出CannotResolveClassException异常错误的问题

https://stackoverflow.com/questions/9508292/nodecom-thoughtworks-xstream-mapper-cannotresolveclassexception-while-using-xstr
This commit is contained in:
yearliny
2021-09-25 23:05:28 +08:00
committed by GitHub
parent abbfc85e24
commit b45c626e82

View File

@@ -150,6 +150,7 @@ public abstract class BaseWxPayResult {
}
XStream xstream = XStreamInitializer.getInstance();
xstream.processAnnotations(clz);
xstream.setClassLoader(BaseWxPayResult.class.getClassLoader());
T result = (T) xstream.fromXML(xmlString);
result.setXmlString(xmlString);
return result;