File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
weixin-java-common/src/main/java/me/chanjar/weixin/common/util/xml Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1111import com .thoughtworks .xstream .io .xml .XppDriver ;
1212import com .thoughtworks .xstream .security .NoTypePermission ;
1313import com .thoughtworks .xstream .security .WildcardTypePermission ;
14-
1514import java .io .Writer ;
1615
1716/**
2019 * @author Daniel Qian
2120 */
2221public class XStreamInitializer {
22+
23+ public static ClassLoader classLoader ;
24+
25+ public static void setClassLoader (ClassLoader classLoaderInfo ) {
26+ classLoader = classLoaderInfo ;
27+ }
28+
2329 private static final XppDriver XPP_DRIVER = new XppDriver () {
2430 @ Override
2531 public HierarchicalStreamWriter createWriter (Writer out ) {
@@ -87,7 +93,10 @@ protected void setupConverters() {
8793 xstream .addPermission (new WildcardTypePermission (new String []{
8894 "me.chanjar.weixin.**" , "cn.binarywang.wx.**" , "com.github.binarywang.**"
8995 }));
90- xstream .setClassLoader (Thread .currentThread ().getContextClassLoader ());
96+ if (null == classLoader ) {
97+ classLoader = Thread .currentThread ().getContextClassLoader ();
98+ }
99+ xstream .setClassLoader (classLoader );
91100 return xstream ;
92101 }
93102
You can’t perform that action at this time.
0 commit comments