为什么有横线的这行报错

来源:-

hdh19942

2017-06-23 13:50

public  static  String  textMessageToXml(TextMessage  textMessage){
    XStream   xtstream=new XStream();
    xtstream.alias("xml", textMessage.getClass());
    return xtstream.toXML(textMessage);  
}


报错java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)
    at com.thoughtworks.xstream.XStream.<init>(XStream.java:336)
    at h.d.h.util.com.MessageUtil.textMessageToXml(MessageUtil.java:41)
    at h.d.h.com.WeixinService.doPost(WeixinService.java:50)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)


写回答 关注

1回答

  • 小皮丘
    2017-06-26 18:08:03

    没有导入  XStream的jar包,

    (1)可以网上下载

    (2)在pom.xml中加入依赖

    <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->

    <dependency>

    <groupId>com.thoughtworks.xstream</groupId>

    <artifactId>xstream</artifactId>

    <version>1.4.9</version>

    </dependency>


初识Java微信公众号开发

Java微信公众号开发的入门教程,掌握微信公众号基本概念

158330 学习 · 469 问题

查看课程

相似问题