请高手指点我在struts2.0整合jsonplugin-0.32.jar 时候,
出现下面这个问题,  
出现时间:当程序从后台取出数据后。2010-12-9 17:01:09 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.AbstractMethodError
at org.apache.commons.dbcp.DelegatingConnection.getClientInfo(DelegatingConnection.java:663)
at org.apache.commons.dbcp.DelegatingConnection.getClientInfo(DelegatingConnection.java:663)
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 org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
at $Proxy4.getClientInfo(Unknown Source)
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:161)
at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:127)
at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:323)
at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)

解决方案 »

  1.   

    jsonplugin-0.31.jar + struts2-core-2.0.9.jar 没有这个问题 你的2个jar匹配吗?
      

  2.   

    我用的 是 struts2-core-2.0.11.2.jar +jsonplugin-0.32.jar 应该是可以的吧。
    这是我配置文件中写的:
    <package name="json" extends="json-default">
    <action name="json_item" class="subitemAction" >
    <result  type="json"></result>
    </action>
    </package>
      

  3.   

    我action中的代码:
    public String getSubitem(){
     str ="{str:"+1+"}"; 
    System.out.println( "str::::"+str );
    return SUCCESS;
    }
      

  4.   

    哎  还是我自己解决吧。
    原因是:action中有其他的get方法,使得转换的时候也要把其他的方法转换,由于转换类不认识所以出错。
    你可以把其他的带有get的方法都去掉试一下还出现这个错误不,如果不出现就是这个错误。
    再次粘贴错误信息:2010-12-10 10:27:56 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet default threw exception
    java.lang.AbstractMethodError
    at org.apache.commons.dbcp.DelegatingConnection.getClientInfo(DelegatingConnection.java:663)
    at org.apache.commons.dbcp.DelegatingConnection.getClientInfo(DelegatingConnection.java:663)
    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 org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
    at $Proxy4.getClientInfo(Unknown Source)
    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:161)
    at com.googlecode.jsonplugin.JSONWriter.value(JSONWriter.java:127)
    at com.googlecode.jsonplugin.JSONWriter.add(JSONWriter.java:323)
    at com.googlecode.jsonplugin.JSONWriter.bean(JSONWriter.java:225)
    at com.googlecode.jsonplugin.JSONWriter.process(JSONWriter.java:161)