`

Positioned Update not supported异常解决方法

    博客分类:
  • JSON
阅读更多
今天在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。
5
2
分享到:
评论
3 楼 天枢贪狼 2011-11-02  
感谢楼主 算是帮了大忙 初学json 发现好多不懂
2 楼 bingxue2332 2009-12-17  
ynstudio 写道

		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);


我加入了上面的代码但是好像不能生效 ?
1 楼 ynstudio 2009-09-28  

		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);

相关推荐

    My sql 驱动程序

    My sql 驱动程序,打成包了,找了好久才找到的

    Stack与Align、Stack与Positioned、Flutter AspectRatio、Card卡片、Wrap

    此资源介绍的相关内容有:页面布局 Stack层叠组件、Stack与Align、Stack与Positioned实现定位布局、Flutter AspectRatio、Card卡片组件、卡片图文列表、Wrap组件。 适合新手学习移动端开发,也适合老司机参考。

    东芝电梯故障代码合集.pdf

    "东芝电梯故障代码合集.pdf" ...本资源摘要信息涵盖了东芝电梯故障代码合集的方方面面,包括故障代码列表、故障码出错检查主题、故障码处理方法等,旨在帮助用户快速查找和解决东芝电梯的故障问题。

    Flutter布局组件之层叠组件Stack和Positioned

    层叠布局 Stack、Positioned 层叠布局和Web中的绝对定位、Android中的Frame布局是相似的,子组件可以根据距父容器四个角的位置来确定自身的位置。绝对定位允许子组件堆叠起来(按照代码中声明的顺序)。Flutter中...

    wifi_positioned:wifi本地化演示

    wifi_positioned wifi定位Demo RSSI指纹库 Knn算法

    positioned-io-preview-读取和写入偏移-Rust开发

    positioned-io这个板条箱允许您指定读写偏移量,而无需更改文件中的当前位置。 这类似于preposition-io。此板条箱可让您指定读写偏移量,而无需更改文件中的当前位置。 这类似于C中的pread()和pwrite()。这种...

    futureinternet-10-00020-v2.pdf

    In 2017, Gartner positioned blockchain close to the peak of inflated expectations, acknowledging the enthusiasm for this technology that is now largely discussed by media. In this scenario, the risk ...

    stbc.rar_The Signal_stbc_ui_start

    The cursor needs to be positioned on these for detailed explanation. The main file is "runsim.m". In these simulations the SISO option is not explicitly given. This is because the SISO result for a ...

    positioned-relative-to-crx插件

    语言:English (UK) Chrome DevTools扩展程序,显示所选元素相对于其定位的父元素。 Chrome DevTools扩展程序,显示所选元素相对于其定位的父元素。

    Sublime Text Build 3124 x64 Setup.exe

    Fixed Replace not working as expected in conjunction with regex look behinds Fixed build systems being unable to use "file_patterns" with the exec command Corrected tab overlap on HiDPI Windows and ...

    指纹图像处理

    指纹检测识别matlabIn this paper the problem of fingerprint verification via the Internet is ...as minutiae, are uniquely positioned. Furthermore, such methods may be subject to attacks by hackers when

    c#primer plus附录

    more than one operator can operate on an operand (because the operators are positioned next to the operand, one on either side), this operand is first processed by the operator of the higher ...

    flutter 总结及遇到的问题集合

    * Flutter 中的弹性布局可以使用 Positioned 来实现。 * Flutter 中的背景图像可以使用 Container 的 decoration 来实现。 * Flutter 中的文本超出可以使用 Text 的 overflow 属性来实现。 Flutter 是一个功能强大...

    Compiler Building Tutorial

    To bring the files up to date and get myself positioned to continue the series, I recently (1994) converted all the files to work with Microsoft Word for Windows. Unlike Sprint, Word allows you to ...

    Understanding Big Data--IBM

    Big Data represents a new era in data exploration and utilization and IBM is uniquely positioned to help clients navigate this transformation This book reveals how IBM is leveraging open source Big ...

    visual assist v 10.4.1632 with crack

    (case=5567, case=7457) 6027, 6021 Listboxes are positioned such that they are not truncated at the right edge of the screen. (case=5178) Listbox remains on the same side of a symbol (either ...

    Java SE 8 for the Really Impatient

    Eagerly anticipated by millions of programmers, Java SE 8 is the most important Java update in many years. The addition of lambda expressions (closures) and streams represents the biggest change to ...

    ATX Specification

    A change to the system form factor is ultimately of little benefit if it does not reduce overall system cost. ATX has achieved cost reduction in a number of ways: • Material cost of cables and add-in...

    2020科技趋势报告.pdf

    It’s difficult not to see unsettling parallels to our present-day world. But we are positioned to make better choices this time around. A century ago, the tools of modern strategic foresight hadn’t ...

Global site tag (gtag.js) - Google Analytics