首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

Positioned Update not supported错误解决办法

2012-10-30 
Positioned Update not supported异常解决方法今天在SSH项目中遇到运用JSON插件,产生如下异常:2008-11-15

Positioned Update not supported异常解决方法
今天在SSH项目中遇到运用JSON插件,产生如下异常:

2008-11-15 12:58:21 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet default threw exceptionjava.sql.SQLException: Positioned Update not supported.at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)at com.mysql.jdbc.ResultSetImpl.getCursorName(ResultSetImpl.java:2050)at com.mchange.v2.c3p0.impl.NewProxyResultSet.getCursorName(NewProxyResultSet.java:545)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:224)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:321)at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:157)at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:123)at com.googlecode.jsonplugin.JSONWriter.write(JSONWriter.java:91)at com.googlecode.jsonplugin.JSONUtil.serialize(JSONUtil.java:90)at com.googlecode.jsonplugin.JSONResult.execute(JSONResult.java:173)at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)at zz.WebNews.util.AuthorizationInterceptor.intercept(AuthorizationInterceptor.java:62)at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)at zz.WebNews.util.AuthFilter.doFilter(AuthFilter.java:62)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)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:175)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)at java.lang.Thread.run(Unknown Source)

该异常有两种解决方法:
第一:在struts.xml文件的配置中排除不要被JSON序列化的属性,例如:
<action name="functions" method="functions_getList">    <result type="json">     <param name="excludeProperties">functionsService</param>    </result>    </action>

其中functionsService就是不要被JSON序列化的属性。
第二:在Action文件中去除不要被JSON序列化的属性的get()方法,例如:
public IFunctionsService getFunctionsService() {return functionsService;}

这样做functionsService同样不会被JSON序列化。

说明:
带有transient修饰符与没有Getter方法的字段(field)都不会被串行化为JSON。conf.setJsonPropertyFilter(new PropertyFilter(){ public boolean apply(Object source, String name, Object value) { if(source.getClass().getName().indexOf("$$EnhancerByCGLIB$$")>0){ try {if(source.getClass().getSuperclass().getField(name) != null)return false;} catch (SecurityException e) {e.printStackTrace();} catch (NoSuchFieldException e) {e.printStackTrace();}return true; } return false; }});....JSONArray jsonArr = JSONArray.fromObject(xxxxx,conf);conf.setJsonPropertyFilter(new PropertyFilter(){ public boolean apply(Object source, String name, Object value) { if(source.getClass().getName().indexOf("$$EnhancerByCGLIB$$")>0){ try {if(source.getClass().getSuperclass().getField(name) != null)return false;} catch (SecurityException e) {e.printStackTrace();} catch (NoSuchFieldException e) {e.printStackTrace();}return true; } return false; }});....JSONArray jsonArr = JSONArray.fromObject(xxxxx,conf);
我加入了上面的代码但是好像不能生效 ? 3 楼 天枢贪狼 2011-11-02   感谢楼主 算是帮了大忙 初学json 发现好多不懂

热点排行