- 浏览: 681002 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (198)
- 编程经验 (12)
- 移动端 (2)
- linux (1)
- 基础理论 (10)
- 开发工具 (8)
- 开发语言_java (21)
- 开源框架_Axis2 (8)
- GIS开发_OpenLayers (9)
- GIS开发_ArcGIS (6)
- GIS开发_googleAPI (4)
- GIS开发_AO (2)
- Web前端_Javascript (7)
- Web前端_CSSDIV (2)
- Web前端_WebGL (5)
- Web前端_HTML5 (1)
- 数据库 (17)
- 项目管理 (6)
- REST服务_Restlet (0)
- REST服务_RestEasy (5)
- 连接池 (6)
- 框架组合_SSI (7)
- 框架组合_SSH (37)
- 异常处理 (10)
- 测试 (1)
- ASP/ASP.NET (3)
- 我所遇到的JavaScript (1)
- cas (1)
- CI (1)
- nginx (1)
- 大数据 (1)
- maven (1)
- 机器学习 (0)
最新评论
-
章元o:
正解,问题解决了,要换tomcat的
webservice开发时项目启动过程中出现版本问题 -
dcloud:
大师,按照你的指点进行初始化工作,但是在connection. ...
AO连接sde出现java.lang.UnsatisfiedLinkError: no ntvauth in java.library.path -
yiran0314:
您好 关于这个问题能描述得更详细一点吗?
CXF异常处理 -
tianhandigeng:
找了半个小时了也没小号到m2e最新的地址,既然这个都让你找得这 ...
Myeclipse8.6安装Maven插件------ -
wxb880114:
这个发的比较早了,现在在myeclipse中有自带的,ecli ...
Myeclipse8.6安装Maven插件------
调用JSONArray.fromObject(stss)出现java.lang.reflect.InvocationTargetException错误
java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher
net.sf.json.util.JSONTokener.nextValue(JSONTokener.java:355)
net.sf.json.JSONArray._fromJSONTokener(JSONArray.java:917)
net.sf.json.JSONArray._fromString(JSONArray.java:983)
net.sf.json.JSONArray.fromObject(JSONArray.java:141)
net.sf.json.JSONArray.fromObject(JSONArray.java:120)
clientwebaction.DataAction.dataView(DataAction.java:163)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
少了ezmorph 1.0.6包
使用json-lib.jar包,以下的包是必须的:
jakarta commons-lang 2.5
jakarta commons-beanutils 1.8.0
jakarta commons-collections 3.2.1
jakarta commons-logging 1.1.1
ezmorph 1.0.6
java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher
net.sf.json.util.JSONTokener.nextValue(JSONTokener.java:355)
net.sf.json.JSONArray._fromJSONTokener(JSONArray.java:917)
net.sf.json.JSONArray._fromString(JSONArray.java:983)
net.sf.json.JSONArray.fromObject(JSONArray.java:141)
net.sf.json.JSONArray.fromObject(JSONArray.java:120)
clientwebaction.DataAction.dataView(DataAction.java:163)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
少了ezmorph 1.0.6包
使用json-lib.jar包,以下的包是必须的:
jakarta commons-lang 2.5
jakarta commons-beanutils 1.8.0
jakarta commons-collections 3.2.1
jakarta commons-logging 1.1.1
ezmorph 1.0.6
发表评论
-
浅析Static用法解析java语言
2013-05-08 10:32 807在类中定义的数据成为 ... -
httpclient报异常
2013-03-17 21:14 3347Exception in thread "main& ... -
(转载)java synchronized详解
2013-01-25 10:44 771java synchronized详解 记下来,很重要。 ... -
JDBC Connection接口实现ResultSet的方法
2013-01-24 15:27 1146JDBC Connection接口实现Resu ... -
基于JDBC的数据库连接池高效管理策略
2013-01-24 08:43 743基于JDBC的数据库连接池高效管理策略 发布时间:2 ... -
关于一个大型WEB系统架构设计和技术选型的讨论摘录
2013-01-23 09:06 1001关于一个大型WEB系统架 ... -
技术选型(转)
2013-01-22 21:41 815博客分类: Java SpringHi ... -
HTTP Status 405 - HTTP method GET is not supported by this URL
2012-11-30 13:25 1362出现错误的原因: 1,继承HttpServlet的Ser ... -
JVM内存资源耗尽,有解决方案吗?
2012-09-24 09:09 963去了趟sun,知道为什么了,heap,stack都有大小限制. ... -
转载 :网站并发测试工具
2012-09-21 09:33 947转载 :网站并发测试工 ... -
获取客户端Ip地址网上方案总结
2012-09-09 11:03 1093客户端: <script language=" ... -
对象与JSON之间的转换
2012-09-04 10:13 938JSON-lib这个Java类包用于把bean,map和XML ... -
How Tomcat Work——Tomcat 的默认连接器
2012-08-28 07:48 778注意: 本章中提及的“ ... -
Socket用法详解-----转载
2012-08-24 09:22 1612Socket用法详解 原文:ht ... -
数据结构与算法——数组实现Stack代码
2012-08-17 20:33 899package com.part02; publ ... -
数据结构与算法——简单排序
2012-08-14 21:13 845public class Sort { //存值 ... -
EL表达式取值
2012-07-23 16:55 1443EL表达式取值 1.EL表达式的语法格式很简单: 以前 ... -
Java基础学习------Vector类
2012-07-16 09:47 965一、定义 Vector 类可 ... -
Java基础学习------字符串、String类、StringBuffer类、StringBuilder类总结
2012-07-14 15:09 944一、定义: 字符串是字符的序列、它可以包含字母、数字和其 ... -
java字符串与整数之间的互相转换
2012-07-12 09:32 1622java字符串与整数之间的互相转换 1、如何将字符串S ...
相关推荐
然而,为了能够正确地调用 `JSONArray.fromObject()`,你需要引入特定的库,也就是相关的JAR包。 在给定的文件列表中,我们看到以下几个JAR包: 1. **json-lib-2.4-jdk15.jar**: 这是JSON库的一个实现,名为`json-...
关于使用JSONArray.fromObject()方法和引入net.sf.json包所需要的依赖包:commons-beanutils.jar,commons-httpclient.jar,commons-lang.jar,ezmorph.jar,morph-1.0.1.jar
使用jsonArray.fromObject转json必须导入五个jar, 包含:commons-lang.jar commons-beanutils.jar commons-collections.jar commons-logging.jar ezmorph.jar json-lib-2.2.2-jdk15.jar
JSONArray jsonArray = JSONArray.fromObject("[\"Apple\", \"Banana\", \"Orange\"]"); System.out.println(jsonArray.getString(1)); // 输出 "Banana" ``` 同样,`JSONObject`提供类似的功能,用于处理JSON对象...
包含 json-lib-2.4-jdk15.jar , ezmorph-1.0.6.jar commons-logging-1.2.jar commons-lang-2.5.jar commons-collections-3.2.jar commons-beanutils-1.8.0.jar
Iterator<Object> iterator = jsonArray.iterator(); while (iterator.hasNext()) { Object element = iterator.next(); System.out.println(element); } ``` 四、序列化与反序列化 JSONArray提供toString()方法...
- 转换为Java对象集合:如果每个元素对应一个Java类的实例,可以使用`JSONArray.toJavaList(Class)`进行转换。 5. **JSON字符串与JSONArray之间的转换** - 将JSONArray转换为JSON字符串:`String jsonString = ...
`JSONArray.fromObject()`方法是将Java对象转换为`JSONArray`的便利方法。这个方法非常实用,因为它允许我们直接将`Map`、`List`等Java集合对象转换为JSON格式,而无需手动构建JSON字符串。 #### 1. 解析Map 如果...
JSONArray jsonArray = JSONArray.fromObject(jsonString, jsonConfig); JSONObject jsonObject; Object pojoValue; List<T> list = new ArrayList(); for (int i = 0; i < jsonArray.size(); i++) { ...
JSONObject jsonobj=JSONObject.fromObject(resultData);//将字符串转化成json对象 JSONArray jsonArray = jsonobj.getJSONArray("data");//获取数组 List< PubUnit> pubUnits = new ArrayList(); for (int i = ...
JSONArray jsonArray2 =JSONArray.fromObject( list ); 2. Map集合转换成json代码 Map map = newHashMap(); map.put("name","json"); map.put("bool",Boolean.TRUE); map.put("int", newInteger(1)); map.put...
`JSONArray.jar`及其附加的`jar`文件是用于处理JSON数据的一个Java库。JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,常用于在客户端和服务器之间传输数据。`JSONArray`是这个库中的一个类,它...
4. **转换回JSONArray**:最后,使用`JSONArray.fromObject()`方法将`HashSet`转换回`JSONArray`。 ### 注意事项 1. **类型一致性**:确保`JSONArray`中的所有元素都是同一种类型,否则转换到`List`时可能会出现...
JSONArray array = JSONArray.fromObject(jsonString); arrObj = new Object[array.size()]; for (int i = 0; i < array.size(); i++) { JSONObject jsonObject = array.getJSONObject(i); arrObj...
java对象转json所需要的包 解决JSONObject.fromObject()和JSONArray.fromObject()报 java.lang.NoClassDefFoundError的问题。 导入jar包后请 import net.sf.json.JSONArray; import net.sf.json.JSONObject;
反过来,使用`JSONObject.fromObject()`或`JSONArray.fromObject()`可以将JSON字符串解析为Java对象: ```java JSONObject parsedObject = JSONObject.fromObject(jsonString); ``` 此外,`net.sf.json`库依赖于...
这可以通过`JSONArray.fromObject()`将JSON字符串转换为`JSONArray`,然后使用`JSONArray.toList()`方法将其转化为指定类型的列表,如下所示: ```java String jsonArrayString = "[...]"; JSONArray jsonArray = ...
接着,通过调用`JSONArray.fromObject(list)`将这个`List`转换为`JSONArray`对象,最终输出转换后的JSON字符串。 ### 总结 本文介绍了如何在Java中实现JSON与List之间的相互转换。通过使用`JSONArray`类提供的方法...
- 通过索引获取元素:`JSONObject jsonObject = jsonArray.getJSONObject(index);` - 获取基本类型值:`String str = jsonArray.getString(index); int num = jsonArray.getInt(index); boolean bool = jsonArray....
jsonArray = JSONArray.fromObject(Arrays.asList("apple", "banana", "orange")); ``` 2. 添加元素:可以使用`add`方法添加JSON元素,包括其他JSONArray、JSONObject、基本类型或其包装类。 ```java jsonArray.add...