zalopay-oss / jmeter-grpc-plugin

A JMeter plugin supports load test gRPC
Apache License 2.0
42 stars 23 forks source link

java.lang.NoSuchMethodException: com.***.payment.integrator.v1.BraintreeClientImplGrpc.newBlockingStub(io.grpc.Channel) #17

Open debayandesarkar opened 3 years ago

debayandesarkar commented 3 years ago

Hi, Thanks for sharing this implementation. I am trying to make this work for one grpc based service and getting the below exception. Can you please help in troubleshooting this error?

2021-04-27 20:22:30,826 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,827 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,832 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,833 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2021-04-27 20:22:30,833 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2021-04-27 20:22:30,834 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2021-04-27 20:22:30,974 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2021-04-27 20:22:30,974 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2021-04-27 20:22:30,974 INFO v.z.j.g.c.GrpcClientSampler: Created GrpcClientSampler
2021-04-27 20:22:30,975 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2021-04-27 20:22:30,975 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2021-04-27 20:22:30,975 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2021-04-27 20:22:30,978 ERROR v.z.j.g.c.GrpcClientSampler: Call initGrpcClient has thrown an exception: 
java.lang.NoSuchMethodException: com.***.payment.integrator.v1.BraintreeClientImplGrpc.newBlockingStub(io.grpc.Channel)
    at java.lang.Class.getMethod(Class.java:2122) ~[?:?]
    at vn.zalopay.jmeter.grpc.utils.GrpcUtils.getBlockingStub(GrpcUtils.java:183) ~[jmeter-grpc-client-sampler.jar:?]
    at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.initGrpcClient(GrpcClientSampler.java:80) [jmeter-grpc-client-sampler.jar:?]
    at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:92) [jmeter-grpc-client-sampler.jar:?]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
    at java.lang.Thread.run(Thread.java:832) [?:?]
2021-04-27 20:22:30,979 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'GRPC Client Sampler BIS 3'.
java.lang.NullPointerException: null
    at vn.zalopay.jmeter.grpc.client.GrpcClientSampler.sample(GrpcClientSampler.java:95) ~[jmeter-grpc-client-sampler.jar:?]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) ~[ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
    at java.lang.Thread.run(Thread.java:832) [?:?]
2021-04-27 20:22:30,980 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2021-04-27 20:22:30,980 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2021-04-27 20:22:30,980 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2021-04-27 20:22:30,980 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
Screen Shot 2021-04-27 at 8 21 45 PM

Regards Debayan

thoainguyen commented 3 years ago

Hi, I guess that you didn't put the jar package which contains Protobuf java classes into folder lib/ext (STEP 1 in README, pls see the guide to create a proper one). In case you have already followed that step, but the error still happens, try to use my hello example proto in README for a demo, after that, you can predict how the plugin work, how to use that, it is easy with that example, and continue smoothly in your circumstance. Finally, if you also continue to get stuck, let me know

debayandesarkar commented 3 years ago

@thoainguyen Thank you for your response. I have generated the jar file from the project containing the .proto files. However, the proto files do not have any service and method declaration . It only has the request and response definition with field mapping. I will troubleshoot further on our service implementation which is using java spring boot.

Regards Debayan