huailide opened a new issue #8175:
URL: https://github.com/apache/skywalking/issues/8175


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar feature requirement.
   
   
   ### Description
   
   When I use pulsar plugin with pulsar client v2.8.1 in my application. I've 
got java.lang.NoSuchMethodError such as below.
   The  root cause is in pulsar client v2.8.1, 
org.apache.pulsar.client.impl.MessageImpl has changed the code.
   
   In pulsar client V2.8.1: org.apache.pulsar.client.impl.MessageImpl
       private final MessageMetadata msgMetadata;
       public static <T> MessageImpl<T> create(MessageMetadata msgMetadata, 
ByteBuffer payload, Schema<T> schema) {
            //...... other code
       }
   In pulsar client other version such as v2.7.1
       private MessageMetadata.Builder msgMetadataBuilder;
       public static <T> MessageImpl<T> create(MessageMetadata.Builder 
msgMetadataBuilder, ByteBuffer payload, Schema<T> schema) {
         //...... other code
       }
   
   
   
   ERROR 2021-11-18 22:46:35:070 XNIO-1 task-16 InstMethodsInter : class[class 
org.apache.pulsar.client.impl.ProducerImpl] before method[sendAsync] intercept 
failure 
   java.lang.NoSuchMethodError: 
org.apache.pulsar.client.impl.MessageImpl.getMessageBuilder()Lorg/apache/pulsar/common/api/proto/PulsarApi$MessageMetadata$Builder;
        at 
org.apache.skywalking.apm.plugin.pulsar.PulsarProducerInterceptor.beforeMethod(PulsarProducerInterceptor.java:75)
        at 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:76)
        at 
org.apache.pulsar.client.impl.ProducerImpl.sendAsync(ProducerImpl.java)
        at 
org.apache.pulsar.client.impl.ProducerImpl.internalSendAsync(ProducerImpl.java:292)
        at 
org.apache.pulsar.client.impl.ProducerImpl.internalSendWithTxnAsync(ProducerImpl.java:363)
        at 
org.apache.pulsar.client.impl.PartitionedProducerImpl.internalSendWithTxnAsync(PartitionedProducerImpl.java:191)
        at 
org.apache.pulsar.client.impl.PartitionedProducerImpl.internalSendAsync(PartitionedProducerImpl.java:167)
        at 
org.apache.pulsar.client.impl.TypedMessageBuilderImpl.sendAsync(TypedMessageBuilderImpl.java:103)
        at 
org.apache.pulsar.client.impl.TypedMessageBuilderImpl.send(TypedMessageBuilderImpl.java:82)
        at org.apache.pulsar.client.impl.ProducerBase.send(ProducerBase.java:63)
        at 
com.yumchina.payhub.writedb.producer.WriteDataUtils.writeDB(WriteDataUtils.java:69)
        at 
com.yumchina.payhub.core.service.impl.BillOrderServiceImpl.saveBillOrderInfo(BillOrderServiceImpl.java:200)
        at 
com.yumchina.payhub.core.service.impl.BillOrderServiceImpl$$FastClassBySpringCGLIB$$4169bb1a.invoke(<generated>)
        at 
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at 
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at 
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)
        at 
com.yumchina.payhub.core.service.impl.BillOrderServiceImpl$$EnhancerBySpringCGLIB$$940b1e43.saveBillOrderInfo(<generated>)
        at 
com.yumchina.payhub.core.controller.BillOrderController.saveBillOrderInfo$original$eMC0LdiO(BillOrderController.java:98)
        at 
com.yumchina.payhub.core.controller.BillOrderController.saveBillOrderInfo$original$eMC0LdiO$accessor$ioTRKrn1(BillOrderController.java)
   
   ### Use case
   
   Pulsar plugin can work normally.
   It can support pulsar client v2.8.1.
   
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to