博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JSONArray().fromObject(); 出现org.apache.catalina.core.StandardWrapperValve invoke错误的解决办法...
阅读量:6897 次
发布时间:2019-06-27

本文共 2293 字,大约阅读时间需要 7 分钟。

hot3.png

servlet:

1 public void service(HttpServletRequest request, HttpServletResponse response) 2     throws ServletException, IOException { 3  4         response.setContentType("text/html");   5         response.setCharacterEncoding("utf-8");   6  7         IBllFrame interfaceOfBllFrame=new BllFrame(); 8         JSONArray json = null; 9 10         List
> result=interfaceOfBllFrame.GetStationPlace();11 System.out.println("GetStationPlace:" + result.get(1).toString());12 try {13 System.out.println("haha begin:" + json);14 15 json=new JSONArray().fromObject(result);//上述错误出现在此句 16 System.out.println("haha success:" + json);17 } 18 catch (Exception e){19 e.printStackTrace();20 }21 22 System.out.println("Servlet---StationPlace"+json);23 PrintWriter out = response.getWriter();24 out.println(json);25 out.flush();26 out.close();27 }

控制器中输出结果如下:

下面为上图中的信息:

GetStationPlace:{StationId=10002, Stationlon=29.90592, Stationlat=121.525976}

haha begin:null
二月 29, 2016 10:37:46 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [GetStationPlaceServlet] in context with path [/BicycleDataSystem] threw exception [Servlet execution threw an exception] with root cause
java.lang.ClassNotFoundException: net.sf.json.JSONArray
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1722)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1573)

 

原先commons-beanutils.jar 、commons-collections.jar、commons-lang.jar、 commons-logging.jar、ezmorph.jar、json-lib.jar这些包放在lib-》json文件夹下如下:

后来commons-beanutils.jar 、commons-collections.jar、commons-lang.jar、 commons-logging.jar、ezmorph.jar、json-lib.jar直接放到lib文件夹下,如下:

注意:就是说将commons-beanutils.jar 、commons-collections.jar、commons-lang.jar、 commons-logging.jar、ezmorph.jar、json-lib.jar这些包一定要直接放在lib文件夹下,否则会出现org.apache.catalina.core.StandardWrapperValve invoke错误。

JSONArray().fromObject需要如下jar包:commons-beanutils.jar 、commons-collections.jar、commons-lang.jar、 commons-logging.jar、ezmorph.jar、json-lib.jar

下载地址:

相关文献:http://greenboy1.iteye.com/blog/1046125

转载于:https://my.oschina.net/landiljy/blog/630997

你可能感兴趣的文章
运维知识总结2
查看>>
linux 各个目录和相关文件的作用等 (混乱版)初学者自用
查看>>
机器权限不能超越人类控制:波音失事案暴露智能软件设计缺陷
查看>>
mac做电影特效用什么软件?NUKE 11 for mac版11.3v4激活版最火的特效软件
查看>>
关于我的公众号Alitaba119的价值
查看>>
XP上安装IIS 6.0的方法
查看>>
UICollectionView 详解
查看>>
shell 练习
查看>>
点赞飘心动画组件FlyHeartView
查看>>
css3 Generator
查看>>
双击运行py文件,并查看打印输出
查看>>
tricks'tips'other
查看>>
nginx屏蔽恶意访问IP
查看>>
进程数监控脚本
查看>>
关于php的魔术常量
查看>>
安装CISCO ASA/PIX ASDM
查看>>
C#对word、excel、pdf等格式文件的操作总结
查看>>
Java常见异常反馈
查看>>
SVN被locked锁定
查看>>
字符串相等的判断
查看>>