Closed wu-sheng closed 6 years ago
It seems like it is not possible to read the class file for org.ofbiz.service.engine.GroovyBaseScript
. Byte Buddy is asked to instrument all classes that have a certain super type and for this purpose, it needs to read all class files that are involved in a class's hierarchy.
With the mentioned class, in order to apply the check, it is necessary to parse its class file to find the class's super types. Without that information, Byte Buddy cannot check what super types the class has and answer the matching request.
To resolve this, you can either check how to better extract class files from specific types of class loaders (by default, the class loader is queried using getResourceAsStream
) or you can handle the error by adding another matcher that excludes the type explicitly or by some other criteria. You can also wrap the matcher to suppress the exception.
I am not sure how.to wrap the matcher to suppress the exception.Can you give me something more explicit or some examples?
The easiest way is to use ElementMatchers.failSafe(...)
but this swallows the exception. Maybe you want to log the error and then you would need to implement something similar yourself.
I found ElementMatchers.failSafe(...)
, but how can I log the exception? Can't find the callback.
I think I get the point.
Implement my own FailSafeMatcher
would help.
I also think that is the best solution for something that custom.
Hi raphw. Skywalking is facing an error when our agent runs in an application based on groovy tech-stack.
Cannot resolve type description for org.ofbiz.service.engine.GroovyBaseScript
exception occurs. I guess the reason is Byte-buddy did some checks for classes, or groovy enging compiling output classes contains something unexpected.Exception
GroovyBaseScript
class:import org.ofbiz.base.util.Debug; import org.ofbiz.service.ServiceUtil import org.ofbiz.service.ExecutionServiceException
abstract class GroovyBaseScript extends Script { public static final String module = GroovyBaseScript.class.getName();
}
ERROR 2017-11-08 16:14:45 SkyWalkingAgent : Failed to enhance class com.xu.drools.Rule_22146222303DefaultConsequenceInvoker java.lang.IllegalStateException: Cannot resolve type description for org.drools.core.rule.builder.dialect.asm.ConsequenceStub