小小孩纸 2015-06-03 14:39 采纳率: 0%
浏览 4176

java做微信开发时报错说HierarchicalStreamDriver类不存在,不知道怎么解决

massageUtil.java

  @SuppressWarnings("unchecked")  
    public static Map<String, String> parseXml(HttpServletRequest request) throws Exception {  
        // 将解析结果存储在HashMap中  
        Map<String, String> map = new HashMap<String, String>();  

        // 从request中取得输入流  
        InputStream inputStream = request.getInputStream();  
        // 读取输入流  
        SAXReader reader = new SAXReader();  
        Document document = reader.read(inputStream);  
        // 得到xml根元素  
        Element root = document.getRootElement();  
        // 得到根元素的所有子节点  
        List<Element> elementList = root.elements();  

        // 遍历所有子节点  
        for (Element e : elementList)  
            map.put(e.getName(), e.getText());  

        // 释放资源  
        inputStream.close();  
        inputStream = null;  

        return map;  
    }  

报错

  @SuppressWarnings("unchecked")  
    public static Map<String, String> parseXml(HttpServletRequest request) throws Exception {  
        // 将解析结果存储在HashMap中  
        Map<String, String> map = new HashMap<String, String>();  

        // 从request中取得输入流  
        InputStream inputStream = request.getInputStream();  
        // 读取输入流  
        SAXReader reader = new SAXReader();  
        Document document = reader.read(inputStream);  
        // 得到xml根元素  
        Element root = document.getRootElement();  
        // 得到根元素的所有子节点  
        List<Element> elementList = root.elements();  

        // 遍历所有子节点  
        for (Element e : elementList)  
            map.put(e.getName(), e.getText());  

        // 释放资源  
        inputStream.close();  
        inputStream = null;  

        return map;  
    }  

包是存在的
图片说明

求大神帮忙

  • 写回答

7条回答 默认 最新

  • 小小孩纸 2015-06-03 14:42
    关注

    报错

     六月 03, 2015 6:58:49 下午 org.apache.catalina.core.AprLifecycleListener init
    信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\JDK7.0\bin;D:\Tomcat\bin
    六月 03, 2015 6:58:50 下午 org.apache.coyote.http11.Http11Protocol init
    信息: Initializing Coyote HTTP/1.1 on http-8080
    六月 03, 2015 6:58:50 下午 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 2228 ms
    六月 03, 2015 6:58:50 下午 org.apache.catalina.core.StandardService start
    信息: Starting service Catalina
    六月 03, 2015 6:58:50 下午 org.apache.catalina.core.StandardEngine start
    信息: Starting Servlet Engine: Apache Tomcat/6.0.39
    六月 03, 2015 6:58:50 下午 org.apache.catalina.startup.HostConfig deployDescriptor
    信息: Deploying configuration descriptor host-manager.xml
    六月 03, 2015 6:58:51 下午 org.apache.catalina.startup.HostConfig deployDescriptor
    信息: Deploying configuration descriptor manager.xml
    六月 03, 2015 6:58:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory docs
    六月 03, 2015 6:58:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory examples
    六月 03, 2015 6:58:52 下午 org.apache.catalina.core.ApplicationContext log
    信息: ContextListener: contextInitialized()
    六月 03, 2015 6:58:52 下午 org.apache.catalina.core.ApplicationContext log
    信息: SessionListener: contextInitialized()
    六月 03, 2015 6:58:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory ROOT
    六月 03, 2015 6:58:52 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory Student
    六月 03, 2015 6:58:53 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory test
    六月 03, 2015 6:58:54 下午 org.apache.catalina.core.ApplicationContext log
    信息: Initializing Spring root WebApplicationContext
    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.
    六月 03, 2015 6:59:06 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory tt
    六月 03, 2015 6:59:06 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory WeChat
    六月 03, 2015 6:59:07 下午 org.apache.catalina.core.ApplicationContext log
    信息: Initializing Spring root WebApplicationContext
    log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
    log4j:WARN Please initialize the log4j system properly.
    六月 03, 2015 6:59:18 下午 org.apache.catalina.startup.HostConfig deployDirectory
    信息: Deploying web application directory Wechat4j
    六月 03, 2015 6:59:18 下午 org.apache.coyote.http11.Http11Protocol start
    信息: Starting Coyote HTTP/1.1 on http-8080
    六月 03, 2015 6:59:18 下午 org.apache.jk.common.ChannelSocket init
    信息: JK: ajp13 listening on /0.0.0.0:8009
    六月 03, 2015 6:59:18 下午 org.apache.jk.server.JkMain start
    信息: Jk running ID=0 time=0/134  config=null
    六月 03, 2015 6:59:18 下午 org.apache.catalina.startup.Catalina start
    信息: Server startup in 28042 ms
    六月 03, 2015 7:01:18 下午 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet WeChatServlet threw exception
    java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at service.CoreService.processRequest(CoreService.java:31)
        at servlet.WeChatServlet.doPost(WeChatServlet.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:744)
    六月 03, 2015 7:01:27 下午 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet WeChatServlet threw exception
    java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at service.CoreService.processRequest(CoreService.java:31)
        at servlet.WeChatServlet.doPost(WeChatServlet.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:744)
    六月 03, 2015 7:01:28 下午 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet WeChatServlet threw exception
    java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
        at service.CoreService.processRequest(CoreService.java:31)
        at servlet.WeChatServlet.doPost(WeChatServlet.java:55)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
        at java.lang.Thread.run(Thread.java:744)
    
    
    评论

报告相同问题?

悬赏问题

  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境
  • ¥30 关于#java#的问题,请各位专家解答!