You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Example implements Serializable {
private static final long serialVersionUID = 493475700851136978L;
private String name;
public String getName() throws IllegalAccessException {
if(name==null){
throw new IllegalAccessException("name is undefined");
}
return name;
}
public static void main(String[] args) {
System.out.println(JSON.toJSONString(new Example()));
}
}
com.alibaba.fastjson.JSONException: write javaBean error, fastjson version 1.2.70, class test.Example, method : getName
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:539)
at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:149)
at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:285)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:758)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:696)
at com.alibaba.fastjson.JSON.toJSONString(JSON.java:661)
at org.apache.dubbo.rpc.support.AccessLogData.getLogMessage(AccessLogData.java:242)
at org.apache.dubbo.rpc.filter.AccessLogFilter.processWithServiceLogger(AccessLogFilter.java:175)
at org.apache.dubbo.rpc.filter.AccessLogFilter.writeLogQueueToFile(AccessLogFilter.java:133)
at org.apache.dubbo.rpc.filter.AccessLogFilter.writeLogToFile(AccessLogFilter.java:153)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalAccessException: name is undefined
The text was updated successfully, but these errors were encountered:
Environment
Steps to reproduce this issue
若存在类使com.alibaba.fastjson.JSON.toJSONString调用异常,如:
将Example作为provider方法参数。
Expected Behavior
access log正常打印,或只报一次异常
Actual Behavior
org.apache.dubbo.rpc.filter.AccessLogFilter#writeLogQueueToFile中processWithServiceLogger或processWithAccessKeyLogger方法调用异常,无法及时清理logQueue,使相同异常重复打印,阻断queue中后续日志打印,log queue也会随着使用逐渐充满。
dubbo 3.0未进行测试,但看代码逻辑是一样的
The text was updated successfully, but these errors were encountered: