Class org.apache.struts2.json.JSONWriter can not access a member of class
2016-01-30 20:27
786 查看
在使用struts2向客户端输出数据的时候,出现错误:
经检测,发现struts2通过ajax返回data的时候,会默认将Action中所有提供getter 的成员属性都序列化,如果有不能序列化的对象,则报错。
解决方法:
1,使用注解注释service,去掉getter
2,get***方法前面加入:@JSON(serialize=false)
<li>Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.interceptor.ExposeInvocationInterceptor$1 with modifiers "public"</li>↵ <li>java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.interceptor.ExposeInvocationInterceptor$1 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
经检测,发现struts2通过ajax返回data的时候,会默认将Action中所有提供getter 的成员属性都序列化,如果有不能序列化的对象,则报错。
解决方法:
1,使用注解注释service,去掉getter
2,get***方法前面加入:@JSON(serialize=false)
相关文章推荐
- linux---安装apache
- Root CA certificate:ApacheJMeterTemporaryRootCA.crt created in JMeter bin directory
- Apache DbUtils 教程
- Apache Prefork、Worker和Event三种MPM分析
- Apache Kafka
- Apache htaccess 重写假设文件存在!
- Apache Kylin 部署之不完全指南
- SparkStreaming运行出现 java.lang.NoClassDefFoundError: org/apache/htrace/Trace 错误
- apache commons io 提案
- 重启Apache报错apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting的解决方法
- Ubuntu下开启Apache重写扩展
- Apache OFBiz技术架构
- apache kafka监控系列-KafkaOffsetMonitor
- apache的开源工具common-fileupload实现文件上传和下载
- Apache Rewrite规则详解
- apache commons io 未来任务与展望
- Apache Spark Jobs 性能调优(二)
- 如何设置Apache中的最大连接数
- Apache Spark Jobs 性能调优(一)
- Java Code Examples for org.apache.commons.codec.binary.Base64InputStream