Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"
2015-04-18 00:04
881 查看
Spring注入Action使用Json错误: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"
异常已经说,不应该访问TruePointcut这个类你没有访问权限(因为它并不是一个public类型的)
解决办法:
在Action里面注入spring时,只能生成set(),而不能有get()
其实就是把引用的业务层接口的get方法删除或者再把action中的getXX()方法上面加上@JSON(serialize=false) 禁止序列化
如:
action里面调用 private UserService userService; 生成getXX()、setXX()后,请删掉getXX(),问题就解决了
异常已经说,不应该访问TruePointcut这个类你没有访问权限(因为它并不是一个public类型的)
解决办法:
在Action里面注入spring时,只能生成set(),而不能有get()
其实就是把引用的业务层接口的get方法删除或者再把action中的getXX()方法上面加上@JSON(serialize=false) 禁止序列化
如:
action里面调用 private UserService userService; 生成getXX()、setXX()后,请删掉getXX(),问题就解决了
相关文章推荐
- 使用json-lib-2.1.jar报,org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"-转载
- Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.in
- 【ssh学习笔记】struts处理json异常之JSONWriter can not access a member of class org.springframework.aop.TruePoin
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- org.apache.struts2.json.JSONWriter can not access a member of class
- Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica
- Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica
- Class org.apache.struts2.json.JSONWriter can not access a member of
- Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica
- org.apache.struts2.json.JSONWriter can not access a member of class
- 解决json结合struts2时,Class org.apache.struts2.json.JSONWriter can not access a member of * 的问题
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- org.apache.struts2.json.JSONWriter can not access a member of class
- Class org.apache.struts2.json.JSONWriter can not access a member of *
- 遇到问题---org.apache.struts2.json.JSONWriter can not access a member of class
- org.apache.struts2.json.JSONWriter can not access a member of class
- 遇到问题---org.apache.struts2.json.JSONWriter can not access a member of class
- 使用json-lib-2.1.jar报,org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSourc
- Java-Struts2:Can not access a member of class with modifiers "public"
- Class org.apache.struts2.json.JSONWriter can not access a member of *(转)