Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: Error while processing sampler: 'Kafka Broker'. java.lang.NullPointerException: Cannot invoke "String.toUpperCase()" because "registry" is null #428

Open
2 tasks done
xck1007 opened this issue Dec 12, 2023 · 11 comments
Assignees

Comments

@xck1007
Copy link

xck1007 commented Dec 12, 2023

What happened?

I get nullpointer exceptions when calling the kafka broker (java request). I can call the schema registry on a test basis. I can call the key schema und the value schema. But the java request (Kafka Broker) receives errors.
Error.zip

KloadGen Version

my built version 5.6.11 on the basis of 5.6.7

Relevant log output

2023-12-12 09:00:10,548 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Kafka Broker'.
java.lang.NullPointerException: Cannot invoke "String.toUpperCase()" because "registry" is null
	at com.sngular.kloadgen.schemaregistry.SchemaRegistryManagerFactory.getSchemaRegistry(SchemaRegistryManagerFactory.java:22) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.loadgen.impl.SRLoadGenerator.retrieveSchema(SRLoadGenerator.java:20) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.loadgen.impl.AvroSRLoadGenerator.setUpGenerator(AvroSRLoadGenerator.java:38) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.sampler.SamplerUtil.configureKeyGenerator(SamplerUtil.java:456) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.setupTest(KafkaProducerSampler.java:83) ~[kloadgen-5.6.11.jar:?]
	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]
	at java.lang.Thread.run(Thread.java:833) [?:?]


2023-12-12 09:00:10,577 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Kafka Broker'.
java.lang.NullPointerException: Cannot invoke "java.util.Collection.toArray()" because "c" is null
	at java.util.ArrayList.<init>(ArrayList.java:181) ~[?:?]
	at com.sngular.kloadgen.randomtool.util.ValueUtils.replaceValuesContext(ValueUtils.java:28) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.randomtool.generator.StatelessGeneratorTool.generateObject(StatelessGeneratorTool.java:38) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.getProducerRecord(KafkaProducerSampler.java:176) ~[kloadgen-5.6.11.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.runTest(KafkaProducerSampler.java:138) ~[kloadgen-5.6.11.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:197) ~[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]
	at java.lang.Thread.run(Thread.java:833) [?:?]

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
@xck1007
Copy link
Author

xck1007 commented Jan 3, 2024

Can someone please help me here.

@AdrianLagartera
Copy link
Member

Could you add the jmx without the Prometheus plugin part to give it a look?

@xck1007
Copy link
Author

xck1007 commented Jan 8, 2024

Here's the file without Prometheus. Thank you very much for looking at it.

kloadgen-without-prometheus.zip

@jemacineiras jemacineiras self-assigned this Jan 8, 2024
@xck1007
Copy link
Author

xck1007 commented Jan 19, 2024

I need to upgrade to the latest jmeter version 5.6.3 for security reasons - I am currently still using version 5.5. They are forcing me to switch to 5.6.3 as soon as possible. If I don't have a solution for kloadgen, I will have to remove kloadgen with a heavy heart.

I would be very happy if kloadgen would work for me.

@jemacineiras
Copy link
Contributor

This is really odd and sad. Still do not know why is failing to your setup since we aree working in the latest for a while.
Can you please attach your full configuration, SO, JDK version, plugins you have installed and a sample JMX. I will try to replcate your setup in order to solve your issue.

Cheers

@xck1007
Copy link
Author

xck1007 commented Jan 23, 2024

I am using JMeter 5.6.2, Windows 10, Java 17.0.3.1, kloadgen 5.6.10 (from https://mvnrepository.com/artifact/com.sngular/kloadgen/5.6.10). I have uploaded the JMX file, jmeter.log, property files and a screenshot with a list of the plugins in a ZIP file.

I also had the errors based on kloadgen 5.6.7 (I built a version myself because the one provided had dependency errors).

If you need anything else to analyse, just let me know. Thank you very much for looking at this :-)

kloadgen-error.zip

@xck1007
Copy link
Author

xck1007 commented Feb 5, 2024

The same error occurs on Ubuntu Linux 22.04 as well. Is there any way I can assist in resolving the issue?

@jemacineiras
Copy link
Contributor

We had tried to reproduce in the same O.S. and versions and we could not see it failing. For all of us is working like a charm. Is there any other way you can send to us.
Let me try to generate a versión with specific debug messages and I will let here the link.

@xck1007
Copy link
Author

xck1007 commented Feb 12, 2024

I have downloaded JMeter version 5.6.2 and kloadgen 5.6.11 again. Nothing else. I still get the error. I can use the button "Test Registry", press the button "Load Subject" at Key Schema and Value Schema, everything is ok. Only when I start the load test do I get the reported errors.

I am now completely at a loss!?!?

jmeter.log

@xck1007
Copy link
Author

xck1007 commented Feb 12, 2024

Sorry, i meant kloadgen 5.6.10.

jmeter.log

@sushmatshetty
Copy link

@xck1007 did u get a solution for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants