当前位置: 代码迷 >> JavaScript >> Struts2 JSON Plugin 错误
  详细解决方案

Struts2 JSON Plugin 错误

热度:748   发布时间:2012-10-29 10:03:53.0
Struts2 JSON Plugin 异常
org.apache.struts2.json.JSONException:java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.PhysicalConnection with modifiers "public"
        org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:243)
        org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
        org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)
        org.apache.struts2.json.JSONWriter.write(JSONWriter.java:99)
        org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:112)
        org.apache.struts2.json.JSONResult.execute(JSONResult.java:198)
       
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:
362)

很简单的问题,但是Google了一下很多没有给出正确的答案

Json Plugin会序列化整个Action, 但是Dao无法序列化.
<result name="success" type="json" >
	<param name="excludeProperties"> 
		  dbManager
	</param>
</result>


exclude无法序列化的部分就可以了
  相关解决方案