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

NullPointerException when calling deserialiser #10

Closed
muffix opened this issue Dec 3, 2018 · 6 comments
Closed

NullPointerException when calling deserialiser #10

muffix opened this issue Dec 3, 2018 · 6 comments

Comments

@muffix
Copy link
Contributor

muffix commented Dec 3, 2018

I've had some trouble getting this plugin to run and was facing a NullPointerException when it reads the first message.

2018-12-05 10:30:16,185 ERROR [histograms_0_314c7ab81c1d] KafkaRpcPluginThread: Exception in kafkaReader or Tsdb Writer
java.lang.NullPointerException: null
	at net.opentsdb.tsd.KafkaRpcPluginThread.run(KafkaRpcPluginThread.java:284) ~[opentsdb-rpc-kafka-0.1.0-all.jar:]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_191]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_191]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_191]

When a new consumer group is created, that group instantiates the specified deserialiser and creates the plugin thread. In its constructor, the thread then goes and gets the deserialiser from the consumer group.
However, since the consumer group first starts the thread and then instantiates the Deserialiser, the reference to the deserialiser in the thread object is null. This reference is never updated which is eventually causing a null pointer exception when the first message comes in.

I think the creation of the threads should happen after the deserialiser is initialised.

muffix added a commit to muffix/opentsdb-rpc-kafka that referenced this issue Dec 3, 2018
This moves the instantiation of the plugin thread objects after the
creation of the deserialiser. Previously, the threads were trying to
access the deserialiser which wasn't initialised yet and were trying to
work with a null pointer.

Resolves: OpenTSDB#10
@mancubus77
Copy link

@muffix mate, have you fixed the issue? Any luck with getting messages from kafka queue? I was playing around this plugin, but was not able to run it because of serialisation issue.
Cheers

@muffix
Copy link
Contributor Author

muffix commented Dec 3, 2018

With the changes from #11 it works for me.

@mancubus77
Copy link

mancubus77 commented Dec 5, 2018

__

@muffix
Copy link
Contributor Author

muffix commented Dec 5, 2018

Yours looks like a completely different issue @mancubus77. It can't find the class net.opentsdb.rollup.RollUpDataPoint which is part of OpenTSDB 2.4. The version in the dependencies (2.4.0-20170603.203549-1) has that class, so it's probably worth checking that. To keep this issue free from unrelated discussion, would you mind creating a separate issue if you still think your problem isn't in your code/setup?

@mancubus77
Copy link

You right mate, sorry

@mancubus77
Copy link

Just want to confirm #1 + @muffix suggestions works fine with 2.4.0RC2

manolama pushed a commit that referenced this issue Dec 28, 2018
* Instantiate plugin threads after deserialiser

This moves the instantiation of the plugin thread objects after the
creation of the deserialiser. Previously, the threads were trying to
access the deserialiser which wasn't initialised yet and were trying to
work with a null pointer.

Resolves: #10

* Fix the name of the deserialiser config setting

Config entries are case sensitive and the readme previously incorrectly
capitalised "Deserializer".

Signed-off-by: Chris Larsen <clarsen@yahoo-inc.com>
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

2 participants