Skip to content

Commit b45c626

Browse files
authored
🐛 修复某些情况下会抛出CannotResolveClassException异常错误的问题
https://stackoverflow.com/questions/9508292/nodecom-thoughtworks-xstream-mapper-cannotresolveclassexception-while-using-xstr
1 parent abbfc85 commit b45c626

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public static <T extends BaseWxPayResult> T fromXML(String xmlString, Class<T> c
150150
}
151151
XStream xstream = XStreamInitializer.getInstance();
152152
xstream.processAnnotations(clz);
153+
xstream.setClassLoader(BaseWxPayResult.class.getClassLoader());
153154
T result = (T) xstream.fromXML(xmlString);
154155
result.setXmlString(xmlString);
155156
return result;

0 commit comments

Comments
 (0)