byte-buddy: IBM J9 error
Hi
SkyWalking gets reports from users in J9 VM. I am not familiar with that. Based on the logs, https://github.com/apache/skywalking/issues/2652#issuecomment-492062199. SkyWalking ProtectiveShieldMatcher prints the logs, such as this
WARN 2019-05-14 10:58:35:839 main ProtectiveShieldMatcher : Byte-buddy occurs exception when match type.
java.lang.IllegalStateException: Cannot resolve type description for java.util.Properties
at org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyTypeDescription.delegate(TypePool.java:1407)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getSuperClass(TypeDescription.java:8024)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$Generic$OfNonGenericType.getSuperClass(TypeDescription.java:3619)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDefinition$SuperClassIterator.next(TypeDefinition.java:314)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDefinition$SuperClassIterator.next(TypeDefinition.java:281)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.matches(HasSuperTypeMatcher.java:53)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.matches(HasSuperTypeMatcher.java:31)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:122)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:160)
I tried to add some ignore rules for these classes, https://github.com/apache/skywalking/compare/j9-compatible , but look like doesn’t work.
ProtectiveShieldMatcher is following our former discussion, it should just simply print the logs and return false as a fail-safe.
/**
* In some cases, some frameworks and libraries use some binary codes tech too. From the community feedback, some of
* them have compatible issues with byte-buddy core, which trigger "Can't resolve type description" exception.
*
* So I build this protective shield by a nested matcher. When the origin matcher(s) can't resolve the type, the
* SkyWalking agent ignores this types.
*
* Notice: this ignore mechanism may miss some instrumentations, but at most cases, it's same. If missing happens,
* please pay attention to the WARNING logs.
*
* @author wu-sheng
*/
public class ProtectiveShieldMatcher<T> extends ElementMatcher.Junction.AbstractBase<T> {
private static final ILog logger = LogManager.getLogger(ProtectiveShieldMatcher.class);
private final ElementMatcher<? super T> matcher;
public ProtectiveShieldMatcher(ElementMatcher<? super T> matcher) {
this.matcher = matcher;
}
public boolean matches(T target) {
try {
return this.matcher.matches(target);
} catch (Throwable t) {
logger.warn(t, "Byte-buddy occurs exception when match type.");
return false;
}
}
}
But this time, it is JVM related classes or eclipse osgi related. does J9VM have some protection mechanism? How should I change the codes?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 45 (11 by maintainers)
Also, I noticed the following log
Is the osgi class define mechanism causing some conflicts?