首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

struts2中使用spring aop时返回json时异常

2012-04-28 
struts2中使用spring aop时返回json时错误liClass org.apache.struts2.json.JSONWriter can not access

struts2中使用spring aop时返回json时错误
<li>Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"</li>
  <li>java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public"</li>
  <li>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"</li>
  <li>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"</li>
  <li>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"</li>

我不用AOP时是没问题的,我在action里调用另一个后台的类的方法,那个方法加入了AOP,然后返回数据给action,aop在方法执行前后都输出了信息,而在返回的数据也在action可以输出,但是返回给客户户短时就出现了上面的错误,是什么原因了
上面说Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers "public,
是不是跟pointcut的配置有关系?

[解决办法]
将action中的get*Service()去掉试试,是spring依赖注入的原因

热点排行