-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
watch等命令 retransformClasses 执行失败 java.lang.InternalError #730
Comments
重新测试了下,发现不是jacoco引起的: import java.io.IOException;
public class TestJmsAppender {
public static void main(String[] args) throws IOException {
System.out.println(org.apache.logging.log4j.core.appender.mom.JmsAppender.class);
System.in.read();
}
} 启动:
用arthas执行:
错误是:
可能是JVM本身的bug,找到两个相关的issue: |
2.8.2版本出错: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -cp /Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-core/2.8.2/log4j-core-2.8.2.jar:. TestJmsAppender 出错: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -cp /Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-core/2.8.2/log4j-core-2.8.2.jar:/Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-api/2.8.2/log4j-api-2.8.2.jar:. TestJmsAppender 2.11.2版本出错: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -cp /Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar:. TestJmsAppender 正常: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -cp /Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.2/log4j-core-2.11.2.jar:/Users/hengyunabc/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar:. TestJmsAppender 在执行watch之前,classloader加载到的类是:
在watch之后,加载到的类是:
发现watch前后,多加载了三个类 org.apache.logging.log4j.Logger , org.apache.logging.log4j.core.ErrorHandler , org.apache.logging.log4j.core.Filter 。 其中 org.apache.logging.log4j.Logger 是在 log4j-api 里的。 |
org.apache.logging.log4j.core.appender.mom.JmsAppender 本身依赖一些JMS的类,在应用的classpath里是没有的。 疑问是:
|
在arthas-mybatis-demo中遇到这个问题,可能是依赖的class not found导致的。
调试发现处理 org.apache.ibatis.logging.log4j.Log4jImpl 这类就会失败抛出异常:
4)查看org.apache.log4j.Priority
trace 这个Log4jImpl,日志错误和上面trace 接口的一样: java.lang.InternalError: null。 |
|
执行:
查看
~/logs/arthas/arthas.log
:用sc命令来查找这个类,发现有非常多的实现类:
查看代码,发现执行的是批量增强:
试下把批量增强关掉:
再来执行:
再查看日志,打印出了具体的类
org.apache.logging.log4j.core.appender.mom.JmsAppender
:再用jad来查看下源代码:
发现是被jacoco处理过的
The text was updated successfully, but these errors were encountered: