SkyWalking Agent启动日志警告AbstractClassEnhancePluginDefine处理

查看 Agent启动日志是发现错误日志如下:

AbstractClassEnhancePluginDefine : enhance class xxx by plugin xxx is not working. Because witness class xxx is not existed.

WARN 2020-07-24 18:37:27:857 AsyncAppender-Worker-ASYNC_KAFKA AbstractClassEnhancePluginDefine : enhance class org.apache.kafka.clients.producer.KafkaProducer$InterceptorCallback by plugin org.apache.skywalking.apm.plugin.kafka.define.KafkaTemplateCallbackInstrumentation is not working. Because witness class org.springframework.kafka.core.KafkaTemplate is not existed.
WARN 2020-07-24 18:37:33:081 main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.method.HandlerMethod by plugin org.apache.skywalking.apm.plugin.spring.mvc.v3.define.HandlerMethodInstrumentation is not working. Because witness class org.springframework.web.servlet.view.xslt.AbstractXsltView is not existed.
WARN 2020-07-24 18:37:33:081 main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.method.HandlerMethod by plugin org.apache.skywalking.apm.plugin.spring.mvc.v4.define.HandlerMethodInstrumentation is not working. Because witness class org.springframework.cache.interceptor.DefaultKeyGenerator is not existed.
WARN 2020-07-24 18:37:33:081 main AbstractClassEnhancePluginDefine : enhance class org.springframework.web.method.HandlerMethod by plugin org.apache.skywalking.apm.plugin.spring.mvc.v5.define.HandlerMethodInstrumentation is not working. Because witness class org.springframework.web.servlet.resource.HttpResource is not existed.

 意思是指在skywalking Agent在加载apm插件时,没有在监听工程中找到对应的jar包。

  • 方案一:如果确实没有用到响应的插件,或者不需要监控相关组件,就可以可以将agent/plugins目录下对应的apm包移到agent/optional-plugins下,这样在agent启动时就不会加载。
  • 方案二:如果确实需要用到apm插件,就需要在所需要监控的工作中引入响应的组件包。

比如我上面的日志:

  • 日志显示apm spring mvc v3、v4、v5加载时springmvc相关类不存在,因为我用的spring5,使用的是web-flux,所以没有springmvc相关jar包,因此我将agent/plugins包下的apm-springmvc-annotation-3.x-plugin-8.0.1.jar、apm-springmvc-annotation-4.x-plugin-8.0.1.jar、apm-springmvc-annotation-5.x-plugin-8.0.1.jar移动到了agent/optional-plugins下。
  • 在加载kafka插件式发现缺少KafkaTemplate类,因为我这用的是ELK组件,没有引入spring-kafka包,因为我需要对kafka相关信息监控,这里我再工程中引入spring-kafka即可。

做完以上调整,启动无异常

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lizz666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值