日期:2014-05-18  浏览次数:20690 次

org.apache.struts2.json.JSONWriter can not access a member of class org.sp
struts2中使用spring的AOP,action返回数据时出现这样的错误,不用AOP时没问题
所有的action及后台的类都是在spring里配置的
<strong>org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"</strong>
    <div>
    org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:250)
    org.apache.struts2.json.JSONWriter.process(JSONWriter.java:164)
    org.apache.struts2.json.JSONWriter.value(JSONWriter.java:130)
    org.apache.struts2.json.JSONWriter.write(JSONWriter.java:98)
    org.apache.struts2.json.JSONUtil.serialize(JSONUtil.java:112)

------解决方案--------------------
Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"

楼主可以把相关的代码拿出来看看。
其实上面的异常已经说的很清楚了,你不应该访问TruePointcut这个类你没有访问权限(因为它并不是一个public类型的)