如何解决WxMpXmlMessage.fromXml出现NoClassDefFoundError?
weixin-java-mp-3.3.0和weixin-java-mp-3.6.0都出现接收消息时转换异常:Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class me.chanjar.weixin.mp.util.xml.XStreamTransformer
1 回复
debug 了解一下,你该去github 提 issues。研究一下代码
class XStreamTransformer {
static int num = 1 / 0;
}
public class Sample {
public static void main(String[] args) throws InterruptedException {
Sample sample = new Sample();
sample.getClassWithInitErrors();
}
private void getClassWithInitErrors() throws InterruptedException {
Thread.sleep(300);
try {
new XStreamTransformer();
} catch (Throwable t) {
t.printStackTrace();
}
Thread.sleep(300);
try {
new XStreamTransformer();
} catch (Throwable t) {
t.printStackTrace();
}
Thread.sleep(300);
try {
new XStreamTransformer();
} catch (Throwable t) {
t.printStackTrace();
}
}
}