比如现在Subject持有Student和Teacher两个类的引用。再进行格式转会的时候,也就是执行JSONObject root = JSONObject.fromObject(sub, config);抛了异常16:00:41,031 WARN JSONObject:940 - Property 'transactionTimeout' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'autoReconnect' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'autoReconnectForConnectionPools' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'capitalizeDBMDTypes' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'characterEncoding' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'detectServerPreparedStmts' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'failedOver' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NCharacterStream' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NClob' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NString' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'SQLXML' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'URL' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'array' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'asciiStream' has no read method. SKIPPED
16:00:41,062 WARN JSONObject:940 - Property 'bigDecimal' has no read method. SKIPPED
16:00:41,062 WARN JSONObject:940 - Property 'binaryStream' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'blob' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'boolean' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'byte' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'bytes' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'characterStream' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'clob' has no read method. SKIPPED我代码中也加了过滤的了config.setJsonPropertyFilter(new PropertyFilter(){
public boolean apply(Object source, String name, Object value) {
if(name.equals("teacher") || name.equals("student")) {
return true;
} else {
return false;
}
}});不知道要怎么改?请高手指点下
16:00:41,031 WARN JSONObject:940 - Property 'autoReconnect' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'autoReconnectForConnectionPools' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'capitalizeDBMDTypes' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'characterEncoding' has no read method. SKIPPED
16:00:41,031 WARN JSONObject:940 - Property 'detectServerPreparedStmts' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'failedOver' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NCharacterStream' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NClob' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'NString' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'SQLXML' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'URL' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'array' has no read method. SKIPPED
16:00:41,046 WARN JSONObject:940 - Property 'asciiStream' has no read method. SKIPPED
16:00:41,062 WARN JSONObject:940 - Property 'bigDecimal' has no read method. SKIPPED
16:00:41,062 WARN JSONObject:940 - Property 'binaryStream' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'blob' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'boolean' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'byte' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'bytes' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'characterStream' has no read method. SKIPPED
16:00:41,078 WARN JSONObject:940 - Property 'clob' has no read method. SKIPPED我代码中也加了过滤的了config.setJsonPropertyFilter(new PropertyFilter(){
public boolean apply(Object source, String name, Object value) {
if(name.equals("teacher") || name.equals("student")) {
return true;
} else {
return false;
}
}});不知道要怎么改?请高手指点下
解决方案 »
- myeclipse9 怎么新建一个 tomcat 工程
- 要用s2sh写一个电子商务网站,麻烦高手指点一下
- 找java项目开发辅导
- appfuse中生成以S结尾的数据表对应的代码出错,有谁有解决的办法或相关的信息吗?
- 高手来看看一个关于ActionForm的问题
- [请教]学了几天webservice,不得其门而入,发帖请教
- Spring+hibernate中加上AOP的事物管理怎么始终出现这样的问题?????
- 哪位高手能解决此问题?
- 请问struts-config.xml怎样配置?
- 关于Image加载的一些小问题?在线等待...
- tomcat 服务器下内存溢出 Java heap space
- 用Tomcat6.0搭建 Servlet问题
从你贴出来的代码中我看不出什么来,只看到一堆的警告WARN 。也不知道里面指的是什么意思,只知道一些不知道是什么的字段没有可读的方法。
其实json只是一堆有规则的字符串。样子很像数组。用于记录数据。别把它看得太复杂。知道了它的本质。
难道你认为字符串还难吗?