Method not found: is$jacocoData

Problems found:

       LZ because troubleshoot, log on through the stepping stones to the test server environment, accidentally discovered the error log in user services which display the following error:

java.beans.IntrospectionException: Method not found: is$jacocoData
    at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:107)
    at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:71)
    at com.xxx.user.service.impl.UserService.fieldsLog(UserService.java:309)
    at com.xxx.user.service.impl.UserService.lambda$log$127(UserService.java:292)
    at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:51)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

Troubleshooting:

       LZ stack positioned by the log to a specific code, and then the local Debug, and does not reproduce the problem. This exclusion problem is not the code itself, and then to the Internet to search for relevant information found in the error is caused by jacoco, and jacoco is used to code coverage statistics unit tested. Then the investigation related to the introduction of the code did not rely immediately start the investigation and user parameters services and found that by javaagent technology into dependency:

root     31787     1  0  2020 ?        02:56:19 java -jar -javaagent:/root/.ci_coverage/jacocoagent.jar=includes=com.user.*,output=tcpserver,port=30041,address=x.x.x.x

To verify is the problem caused by the dependency, LZ download the jar package, add the following parameters Idea VM:

-javaagent:/Users/xxxx(你的jar包目录)/jacocoagent.jar=output=tcpserver,address=127.0.0.1,port=10086  

Then debug in Fileds found more than a piece of field User $ jacocoData, the User object is not in this field, the report Method not found error in the code at:. Is $ jacocoData error. So far, this issue plagued LZ find the root cause.

problem analysis:

       Why after reflection will be more out of a $ jacocoData field it, it is because the code coverage jacoco unit testing, the test will add two members in the class: private static field $ jacocoData and private static methods $ jacocoInit (), two members are marked as synthetic.

problem solved:

       Since when jacoco execution unit testing code coverage, will be a member of the multi-labeled synthetic, then we just need to ignore the synthesis of members in the code on the line.

Reference documents:

       https://github.com/jacoco/jacoco/issues/168

       https://www.eclemma.org/jacoco/trunk/doc/faq.html

发布了67 篇原创文章 · 获赞 64 · 访问量 1万+

Guess you like

Origin blog.csdn.net/jack1liu/article/details/103916788