question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Issue]: Nullpointer at ValueReplacer

See original GitHub issue

What happened?

Expect

Sending Kafka messages with a key that uses a changing UUID.

  • The function ${__UUID()} of JMeter is to be used for this.
  • Variables ${TEST_VAR} can also not be used as an alternative.
  • Nullpointer jmx

Result

A NullPointerException always occur in this case.

More information

KloadGen: 5.1.1 JMeter: 5.5 Schema: Is not required Testplan: Nullpointer.zip (Minimal test plan. A running Kafka is not required to produce the NullPointerException)

KloadGen Version

5.1.1

Relevant log output

2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: KLG - Value Plain - VARIABLE - ❌
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: KLG - Value Plain - VARIABLE - ❌
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.BooleanProperty: true
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: Won't replace true
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: ${TEST_VAR}
2022-09-29 13:59:35,202 DEBUG o.a.j.t.p.AbstractProperty: Not running version, return raw function string
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: ${TEST_VAR}
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: org.apache.kafka.common.serialization.StringSerializer
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: org.apache.kafka.common.serialization.StringSerializer
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: About to replace in property of type: class org.apache.jmeter.testelement.property.StringProperty: 
2022-09-29 13:59:35,202 DEBUG o.a.j.e.u.ValueReplacer: Replacement result: 
2022-09-29 13:59:35,202 DEBUG o.a.j.t.p.AbstractProperty: Not running version, return raw function string
2022-09-29 13:59:35,202 DEBUG o.a.j.t.p.AbstractProperty: Not running version, return raw function string
2022-09-29 13:59:35,202 DEBUG o.a.j.p.j.s.JavaSampler: StandardJMeterEngine@6ec2ddb3-Java Request	testStarted
2022-09-29 13:59:35,202 INFO o.a.j.p.j.s.JavaSampler: Created class: net.coru.kloadgen.sampler.KafkaSchemaSampler. Uses tearDownTest: 
2022-09-29 13:59:35,203 INFO o.a.j.g.u.JMeterMenuBar: setRunning(true, *local*)
2022-09-29 13:59:35,203 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[StandardJMeterEngine,6,main]
java.lang.NullPointerException: null
	at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) ~[jorphan.jar:5.5]
	at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:994) ~[jorphan.jar:5.5]
	at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:976) ~[jorphan.jar:5.5]
	at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:405) ~[ApacheJMeter_core.jar:5.5]
	at java.lang.Thread.run(Thread.java:834) ~[?:?]

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dianaGomezGarcommented, Sep 30, 2022

Hi @fabianAtruvia ,

Thank you for your report. We already know about this error and we are working to fix it. We let you know as soon as we have a solution.

1reaction
jemacineirascommented, Oct 18, 2022

Hi @fabianAtruvia,

there is a PR which will solve this issue. You can test it before merge if you like.

Cheers!

Read more comments on GitHub >

github_iconTop Results From Across the Web

String Replace() giving null pointer exception - Stack Overflow
replace () I want To replace a Charecter From File And Write The Changed Content To Other File.. even though its easy i...
Read more >
java.lang.NullPointerException: replacement == null ... - GitHub
ThirdPartyInvoice.createThirdPartyReturnUrl() method, when the app tries to call the replace() method on a String object, passing a null value ...
Read more >
Null Pointer Exception In Java - GeeksforGeeks
NullPointerException is thrown when program attempts to use an object reference that has the null value.
Read more >
String replace method error (Example) | Treehouse Community
My code (the comments on the right is the value of the variable: // get user data from session HashMap<String, String> user =...
Read more >
Use the Safe Navigation Operator to Avoid Null Pointer ...
Use the safe navigation operator (?.) to replace explicit, sequential checks for null references. This new operator short-circuits expressions that attempt ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found