skywalking icon indicating copy to clipboard operation
skywalking copied to clipboard

SkyWalkingAgent : Enhance class redis.clients.jedis.Jedis error.

Open ruqinhu opened this issue 6 years ago • 5 comments

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • [ ] Question or discussion
  • [ ] Bug
  • [ ] Requirement
  • [ ] Feature or performance improvement

Question

  • What do you want to know? why ?

Bug

  • Which version of SkyWalking, OS and JRE? jdk8,tomcat8,win10, SkyWalking 8.1

  • Which company or project?

  • What happened? If possible, provide a way to reproduce the error. e.g. demo application, component version.

INFO 2020-10-15 15:31:19:642 main AgentClassLoader : D:\software\tomcat\apache-tomcat-8.5.57\path\to\skywalking-agent\plugins\apm-jedis-2.x-plugin-8.1.0.jar loaded. 
INFO 2020-10-15 15:31:19:645 main PluginResourcesResolver : find skywalking plugin define in jar:file:D:\software\tomcat\apache-tomcat-8.5.57\path\to\skywalking-agent\plugins\apm-jedis-2.x-plugin-8.1.0.jar!/skywalking-plugin.def 
INFO 2020-10-15 15:31:20:534 main SnifferConfigInitializer : Config file found in D:\software\tomcat\apache-tomcat-8.5.57\path\to\skywalking-agent\config\agent.config. 
INFO 2020-10-15 15:31:20:538 main PluginResourcesResolver : find skywalking plugin define in jar:file:D:\software\tomcat\apache-tomcat-8.5.57\path\to\skywalking-agent\plugins\apm-jedis-2.x-plugin-8.1.0.jar!/skywalking-plugin.def 
INFO 2020-10-15 15:31:50:858 RMI TCP Connection(2)-127.0.0.1 AgentClassLoader : D:\software\tomcat\apache-tomcat-8.5.57\path\to\skywalking-agent\plugins\apm-jedis-2.x-plugin-8.1.0.jar loaded. 
ERROR 2020-10-15 15:31:52:580 RMI TCP Connection(2)-127.0.0.1 SkyWalkingAgent : Enhance class redis.clients.jedis.Jedis error. 
java.lang.IllegalStateException: Cannot resolve type description for redis.clients.jedis.Jedis$auxiliary$c4ZJojJL
	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:914)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$AbstractBase$OfSimpleType$WithDelegation.getModifiers(TypeDescription.java:8140)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.ModifierReviewable$AbstractBase.matchesMask(ModifierReviewable.java:618)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.ModifierReviewable$AbstractBase.isPublic(ModifierReviewable.java:336)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$AbstractBase.isVisibleTo(TypeDescription.java:7649)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.VisibilityMatcher.matches(VisibilityMatcher.java:48)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.VisibilityMatcher.matches(VisibilityMatcher.java:27)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:46)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ErasureMatcher.matches(ErasureMatcher.java:50)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ErasureMatcher.matches(ErasureMatcher.java:29)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.MethodParameterTypeMatcher.matches(MethodParameterTypeMatcher.java:48)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.MethodParameterTypeMatcher.matches(MethodParameterTypeMatcher.java:27)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.CollectionItemMatcher.matches(CollectionItemMatcher.java:48)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.CollectionItemMatcher.matches(CollectionItemMatcher.java:26)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.NegatingMatcher.matches(NegatingMatcher.java:46)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.MethodParametersMatcher.matches(MethodParametersMatcher.java:49)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.MethodParametersMatcher.matches(MethodParametersMatcher.java:28)
	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$Conjunction.matches(ElementMatcher.java:122)
	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.FilterableList$AbstractBase.filter(FilterableList.java:125)
	at org.apache.skywalking.apm.dependencies.net.bytebuddy.dynamic.scaffold.MethodRegistry$Default.prepare(MethodRegistry.java:505)

Requirement or improvement

  • Please describe your requirements or improvement suggestions. I can not find customer classload. In my project, groovy was used, and I don't know if that's the reason. By the way, when I see other issues, I use ‘agent.is_cache_enhanced_class = false’ to avoid duplicate loading errors

ruqinhu avatar Oct 15 '20 08:10 ruqinhu

Do you use agent.is_cache_enhanced_class as true or false? Default is false, you should use true, if you are facing duplicated enhancement.

wu-sheng avatar Oct 15 '20 14:10 wu-sheng

Do you use agent.is_cache_enhanced_class as true or false? Default is false, you should use true, if you are facing duplicated enhancement.

I just tested the following, just to change the exception from Startup to runtime。

16-Oct-2020 09:28:47.646 涓ラ噸 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable java.lang.ClassFormatError: Duplicate interface name "org/apache/skywalking/apm/agent/core/plugin/interceptor/enhance/EnhancedInstance" in class file org/springframework/web/method/HandlerMethod at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2394) at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:855) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1327) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

ruqinhu avatar Oct 16 '20 01:10 ruqinhu

It is hard to tell what is going on, do you have the demo codes?

wu-sheng avatar Oct 16 '20 01:10 wu-sheng

I specified agent in Tomcat and agent in idea, which caused the agent to load twice.

ruqinhu avatar Oct 21 '20 01:10 ruqinhu

这个是什么问题呢 我也碰到了

zhanghongwang avatar Feb 01 '24 08:02 zhanghongwang