内部类加载器错误

时间:2015-12-04 23:27:39

标签: java classloader powermock jacoco

An internal error occurred during: "Analyzing coverage session TaskTest (Dec 4, 2015 3:14:27 PM)".
loader constraint violation: when resolving method 
"org.objectweb.asm.commons.JSRInlinerAdapter.<init>(ILorg/objectweb/asm/MethodVisitor;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V" 
the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) 
of the current class, org/jacoco/core/internal/flow/MethodSanitizer, 
and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) 
for resolved class, org/objectweb/asm/commons/JSRInlinerAdapter, 
have different Class objects for the type eb/asm/MethodVisitor;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V 
used in the signature

不太确定这是怎么发生的。我在项目早期遇到问题,Powermocks类加载器处理Jacoco代码覆盖。但由于电动摇摆,这似乎并没有发生。如果我正确地读取此错误,则看起来同一个类加载器在同一个类上被加载两次。寻找这个我发现有关Linkage错误的文章,但没有一个真的对此有所帮助。

我可以正常运行Junit测试,它的测试类运行得很好。纯粹当我尝试作为覆盖报告运行时,我得到了这个错误。

有人见过这样的事吗?

0 个答案:

没有答案