From b45c626e8299c9992270382cd90baf2a4b517cd5 Mon Sep 17 00:00:00 2001 From: yearliny Date: Sat, 25 Sep 2021 23:05:28 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E4=BC=9A=E6=8A=9B=E5=87=BACannotRes?= =?UTF-8?q?olveClassException=E5=BC=82=E5=B8=B8=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://stackoverflow.com/questions/9508292/nodecom-thoughtworks-xstream-mapper-cannotresolveclassexception-while-using-xstr --- .../com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java | 1 + 1 file changed, 1 insertion(+) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java index 9f6f5e270..6f66dfdd8 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/result/BaseWxPayResult.java @@ -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;