Json lib 抛出 NestableRuntimeException
2015-07-09 16:25
543 查看
JSONObject 的使用
项目中导入了 json-lib 包,但是在运行如下代码的时候还是出现了如下错误,究其原因是因为缺包,缺了如下5个包:
commons-beanutils-1.8.3
commons-lang-2.6 (注:导入最新的
3.1 版本会继续报如下错误)
commons-collections-3.2.1
commons-logging-1.1.1
ezmorph-1.0.6
Json Lib 下载:json-lib-2.4
import net.sf.json.JSONObject;
public class TestJson {
public static void main(String[] args){
Map<String, String> map = new HashMap<String, String>();
map.put("key", "value");
map.put("name", "abc");
JSONObject json = JSONObject.fromObject(map);
System.out.println(json);
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
......
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
项目中导入了 json-lib 包,但是在运行如下代码的时候还是出现了如下错误,究其原因是因为缺包,缺了如下5个包:
commons-beanutils-1.8.3
commons-lang-2.6 (注:导入最新的
3.1 版本会继续报如下错误)
commons-collections-3.2.1
commons-logging-1.1.1
ezmorph-1.0.6
Json Lib 下载:json-lib-2.4
import net.sf.json.JSONObject;
public class TestJson {
public static void main(String[] args){
Map<String, String> map = new HashMap<String, String>();
map.put("key", "value");
map.put("name", "abc");
JSONObject json = JSONObject.fromObject(map);
System.out.println(json);
}
}
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
......
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
相关文章推荐
- js json to string
- 也说Javascript对象拷贝及疑问
- js获取url中的参数
- javascript 监测页面离开事件
- ExtJs使用总结(非常详细)
- JSP九大内置对象及四个作用域
- JS中Date对象getYear()方法和getFullYear()方法区别
- JavaScript学习总结(二)
- Json解析
- Extjs下拉框扩展
- JavaScript中的闭包(Closure)
- extjs插件开发上传下载文件简单案例
- JavaScript对象复制拷贝
- Json常见问题
- javascript闭包
- js遍历radio代码
- JSP生成静态的HTML页面
- ExtJS学习笔记二:编码规范
- js中的setTimeout与setTimeInterval
- Javascript 正则表达式_5