kloadgen: [com.sngular.kloadgen.serializer.ProtobufSerializer - NullPointerException]:

What happened?

Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method com.squareup.wire.schema.internal.parser.ProtoParser$Companion.parse, parameter data

KloadGen Version

kloadgen-5.2.10.jar

Relevant log output

2023-01-31 11:47:41,804 INFO o.a.j.e.StandardJMeterEngine: Running the test!
2023-01-31 11:47:41,804 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2023-01-31 11:47:41,819 INFO o.a.j.p.j.s.JavaSampler: Created class: com.sngular.kloadgen.sampler.KafkaProducerSampler. Uses tearDownTest: 
2023-01-31 11:47:41,819 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2023-01-31 11:47:42,227 INFO o.a.j.e.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2023-01-31 11:47:42,227 INFO o.a.j.e.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2023-01-31 11:47:42,227 INFO o.a.j.e.StandardJMeterEngine: Thread will continue on error
2023-01-31 11:47:42,227 INFO o.a.j.t.ThreadGroup: Starting thread group... number=1 threads=1 ramp-up=1 delayedStart=false
2023-01-31 11:47:42,227 INFO o.a.j.t.ThreadGroup: Started thread group number 1
2023-01-31 11:47:42,227 INFO o.a.j.e.StandardJMeterEngine: All thread groups have been started
2023-01-31 11:47:42,227 INFO o.a.j.t.JMeterThread: Thread started: Thread Group 1-1
2023-01-31 11:47:42,606 ERROR c.s.k.p.o.ObjectCreatorFactoryHelper: Please, make sure that the schema sources fed are correct
com.google.protobuf.Descriptors$DescriptorValidationException: demo.UnifiedOrder.OrderDetails.total_weight: ".demo.Order.Dimension" is not defined.
	at com.google.protobuf.Descriptors$DescriptorPool.lookupSymbol(Descriptors.java:2465) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$FieldDescriptor.crossLink(Descriptors.java:1480) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$FieldDescriptor.access$1000(Descriptors.java:991) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$Descriptor.crossLink(Descriptors.java:954) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$Descriptor.crossLink(Descriptors.java:950) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$Descriptor.access$800(Descriptors.java:629) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$FileDescriptor.crossLink(Descriptors.java:581) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$FileDescriptor.buildFrom(Descriptors.java:313) ~[kloadgen-5.2.10.jar:?]
	at com.google.protobuf.Descriptors$FileDescriptor.buildFrom(Descriptors.java:282) ~[kloadgen-5.2.10.jar:?]
	at com.github.os72.protobuf.dynamic.DynamicSchema.init(DynamicSchema.java:241) ~[kloadgen-5.2.10.jar:?]
	at com.github.os72.protobuf.dynamic.DynamicSchema.<init>(DynamicSchema.java:203) ~[kloadgen-5.2.10.jar:?]
	at com.github.os72.protobuf.dynamic.DynamicSchema.<init>(DynamicSchema.java:42) ~[kloadgen-5.2.10.jar:?]
	at com.github.os72.protobuf.dynamic.DynamicSchema$Builder.build(DynamicSchema.java:298) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.processor.util.SchemaProcessorUtils.buildProtoDescriptor(SchemaProcessorUtils.java:170) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.processor.objectcreatorfactory.impl.ProtobufObjectCreatorFactory.<init>(ProtobufObjectCreatorFactory.java:45) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.processor.objectcreatorfactory.ObjectCreatorFactoryHelper.getInstance(ObjectCreatorFactoryHelper.java:29) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.processor.SchemaProcessor.processSchema(SchemaProcessor.java:31) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.loadgen.impl.ProtobufLoadGenerator.setUpGenerator(ProtobufLoadGenerator.java:34) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.sampler.SamplerUtil.configureValueGenerator(SamplerUtil.java:346) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.setupTest(KafkaProducerSampler.java:71) ~[kloadgen-5.2.10.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) ~[ApacheJMeter_java.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5]
	at java.lang.Thread.run(Thread.java:834) ~[?:?]
2023-01-31 11:47:42,621 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Kafka Producer Properties'.
java.lang.IllegalArgumentException: Could not parse Protobuf
	at io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema.toProtoFile(ProtobufSchema.java:462) ~[kloadgen-5.2.10.jar:?]
	at io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema.<init>(ProtobufSchema.java:337) ~[kloadgen-5.2.10.jar:?]
	at io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema.<init>(ProtobufSchema.java:326) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.loadgen.impl.ProtobufLoadGenerator.setUpGenerator(ProtobufLoadGenerator.java:44) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.sampler.SamplerUtil.configureValueGenerator(SamplerUtil.java:352) ~[kloadgen-5.2.10.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.setupTest(KafkaProducerSampler.java:71) ~[kloadgen-5.2.10.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) ~[ApacheJMeter_java.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5]
	at java.lang.Thread.run(Thread.java:834) ~[?:?]
Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method com.squareup.wire.schema.internal.parser.ProtoParser$Companion.parse, parameter data
	at com.squareup.wire.schema.internal.parser.ProtoParser$Companion.parse(ProtoParser.kt) ~[kloadgen-5.2.10.jar:?]
	at io.confluent.kafka.schemaregistry.protobuf.ProtobufSchema.toProtoFile(ProtobufSchema.java:455) ~[kloadgen-5.2.10.jar:?]
	... 11 more
2023-01-31 11:47:42,621 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2023-01-31 11:47:42,621 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2023-01-31 11:47:42,628 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2023-01-31 11:47:42,628 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

Have you added your JMX Testplan or a replica?

  • I have added a JMX testplan

Have you added your Schema or a replica?

  • I have added the Schema

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 58 (27 by maintainers)

Commits related to this issue

Most upvoted comments

Hi @jemacineiras, I’m also getting the same error while we are publishing only using the Protobuf Serializer as below. image

Hi @vishaldhanani ,

JMeter 5.6.2 version introduce some changes compared with 5.5, version we use to compile the plugin. I just update the branch and fix (I believe) the incompatibilities. Can you please check the branch?

Should we use the same files attached to this issue for the investigation?

Thanks for the feedback @nrellanti we will take a look

@AdrianLagarteraSngular , Here is the corrected messaging_intra_order_proto.txt file

Hi @nrellanti

Thank you for your collaboration. We are looking at it and we will get back to you as soon as possible.

@jemacineiras , getting below error now with new code.

2023-11-14 11:57:56,080 ERROR o.a.j.t.JMeterThread: Error while processing sampler: ‘Java Request’. java.lang.ClassCastException: class com.squareup.wire.schema.internal.parser.ProtoFileElement cannot be cast to class org.apache.avro.Schema (com.squareup.wire.schema.internal.parser.ProtoFileElement and org.apache.avro.Schema are in unnamed module of loader org.apache.jmeter.DynamicClassLoader @5c647e05) at com.sngular.kloadgen.processor.objectcreatorfactory.impl.AvroObjectCreatorFactory.<init>(AvroObjectCreatorFactory.java:57) ~[kloadgen.jar:3.8.0]

Hello @jemacineiras ,

Tested your latest branch of yesterday’s change, here is the error message. The above error messages are previous branch I.e one/two week ago.

2023-11-14 10:11:33,823 ERROR o.a.j.t.JMeterThread: Error while processing sampler: ‘Java Request’. java.lang.ClassCastException: class com.squareup.wire.schema.internal.parser.ProtoFileElement cannot be cast to class org.apache.avro.Schema (com.squareup.wire.schema.internal.parser.ProtoFileElement and org.apache.avro.Schema are in unnamed module of loader org.apache.jmeter.DynamicClassLoader @5c647e05) at com.sngular.kloadgen.processor.objectcreatorfactory.impl.AvroObjectCreatorFactory.<init>(AvroObjectCreatorFactory.java:57) ~[kloadgen.jar:2.15.2] at com.sngular.kloadgen.processor.objectcreatorfactory.ObjectCreatorFactoryHelper.getInstance(ObjectCreatorFactoryHelper.java:25) ~[kloadgen.jar:2.15.2] at com.sngular.kloadgen.processor.SchemaProcessor.processSchema(SchemaProcessor.java:35) ~[kloadgen.jar:2.15.2] at com.sngular.kloadgen.loadgen.impl.AvroSRLoadGenerator.setUpGenerator(AvroSRLoadGenerator.java:39) ~[kloadgen.jar:2.15.2] at com.sngular.kloadgen.sampler.SamplerUtil.configureValueGenerator(SamplerUtil.java:381) ~[kloadgen.jar:2.15.2] at com.sngular.kloadgen.sampler.KafkaProducerSampler.setupTest(KafkaProducerSampler.java:75) ~[kloadgen.jar:2.15.2] at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:194) ~[ApacheJMeter_java.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.6.2] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.6.2]

@jemacineiras , thank you. I will try and let you know the output. Thanks

Hi @nrellanti ,

I just added the last group of Protobuff well-know types. The branch is still under development. But if you can try it. It will help a lot to speed up.

Cheers

HI @vishaldhanani ,

situation is a bit complex here. At the moment we currently support 1 level deep of import, meaning that we can create a Protobuf object and one leve of imports… I need to rewrite this pieces to support whatever level.

I will try to have asap.

Regarding the type money proto. I manage to add them to the plugin classpath so those should be find in the lastest code.

Will see how it behaves.

Cheers.

HI @vishaldhanani, Looks it’s generating a big object and protobuff serializer cannot handle. can you provide the generated object please? U can add the result tree component and see it there. We add the generated object to the JMeter context for debut and furthers used if it is needed.

Cheers

Hi @nrellanti, At the moment I couldn’t enjoy holidays for now… plenty of things were jumping around. I reopened the 332 branch, update it to master and check the code… and was working for me. Do you mind check if that branch fix you problem so I can work on it?

Cheers.

Hi @vishaldhanani, is holidays season up here so we are kinda short of hands. But I will not forget you.

Cheers

@jemacineiras , yes you can use the same files

Hi @alfredo9f , Tested and verified with other proto files. Thank you very much!

Hi @alfredo9f, Using the most recent jar, I also verified and published messages. Everything is operating exactly as expected. I really appreciate you taking care of this. Thank you all very much 😃

Thank you, Vishal

Hi @nrellanti ,

Thanks to all for the checks. We will wait your confirm 😃

Hi @vishaldhanani ,

We did a small fix so now should works. Please, could you check if now is ok for you?

Thanks in advance!

Hi @vishaldhanani ,

We are taking a look at your last answer, sorry for the delay. Best regards.

@AdrianLagarteraSngular , please see the attached complete messaging_intra_order_proto.txt protobuf file referencing in the messaging_unified_order_proto.txt