Positioned Update not supported异常解决方法

今天在SSH项目中遇到运用JSON插件,产生如下异常:

2008-11-15 12:58:21 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.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" class="getFunctionsAction" 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。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值