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

Exception in thread "Thread-16" java.lang.InstantiationError: org.kairosdb.core.DataPoint #4

Open
javicho21 opened this issue Oct 28, 2015 · 6 comments

Comments

@javicho21
Copy link

Hello @hugocore ,

I'm having a similar issue that FrEaKmAn was having. When I start KairosDB I get this in the log:

18:52:02.754 [main] INFO [Main.java:307] - ------------------------------------------
18:52:02.759 [main] INFO [Main.java:308] - KairosDB service started
18:52:02.760 [main] INFO [Main.java:309] - ------------------------------------------
18:52:02.998 [Thread-16] INFO [null:-1] - [KRMQ] Connecting to RabbitMQ broker.
18:52:03.000 [Thread-16] INFO [null:-1] - [KRMQ] Reading binding configuration from 'conf/bindings.json'.
18:52:03.147 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch1' to queue 'queue1' with bindingkey '#'.
18:52:03.162 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue2' with bindingkey 'color.#'.
18:52:03.177 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue3' with bindingkey 'size.#'.
Exception in thread "Thread-16" java.lang.InstantiationError: org.kairosdb.core.DataPoint
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.consumeMessage(Unknown Source)
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)

I'm currently running KairosDB 1.0.0-1.20150604225857

@hugocore
Copy link
Owner

Hi,

Okay, so KairosDB loaded the plugin and it read the binding configuration and is then waiting for messages. Then it is going to start processing your messages by converting them into KairosDB data points.

Basically the error is saying that it can't instantiate/find the org.kairosdb.core.DataPoint class. Either you don't have the necessary jar file from KairosDB or they deprecated this class completely.

Can you try with KairosDB 0.9.4-5 to check if they deprecated the org.kairosdb.core.DataPoint class.

Let me know.

@javicho21
Copy link
Author

I just downgraded to KairosDB 0.9.4-6.20140730155353 and i'm seeing the same message:

19:26:19.124 [main] INFO [Main.java:266] - ------------------------------------------
19:26:19.126 [main] INFO [Main.java:267] - KairosDB service started
19:26:19.127 [main] INFO [Main.java:268] - ------------------------------------------
19:26:19.366 [Thread-16] INFO [null:-1] - [KRMQ] Connecting to RabbitMQ broker.
19:26:19.385 [Thread-16] INFO [null:-1] - [KRMQ] Reading binding configuration from 'conf/bindings.json'.
19:26:19.490 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch1' to queue 'queue1' with bindingkey '#'.
19:26:19.506 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue2' with bindingkey 'color.#'.
19:26:19.520 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue3' with bindingkey 'size.#'.
Exception in thread "Thread-16" java.lang.InstantiationError: org.kairosdb.core.DataPoint
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.consumeMessage(Unknown Source)
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)

@javicho21
Copy link
Author

oddly enough when i purge the data and delete the queue and THEN restart kairosdb that error message goes away.

so now i've just tried adding the same metric from before which was:

{"unit":"cm","timezone":"Europe/Madrid","collectedtimestamp":"1388530860000","value":"10","sourceTimestamp":"1388530800000"}

as soon as i added this metric i got the error message again:

Exception in thread "Thread-16" java.lang.InstantiationError: org.kairosdb.core.DataPoint
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.consumeMessage(Unknown Source)
at org.kairosdb.plugin.rabbitmq.core.RabbitmqConsumer.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)

@javicho21
Copy link
Author

it appears as if everything is rosy upon startup of kairosdb. as soon as you added a metric to it like the one above it spits up the error message. the only way to get back on track and start adding metrics again is by purging and deleting the queue and then restarting kairosdb. when i restart kairosdb i get a normal message in the log:

19:34:56.912 [main] INFO [Main.java:266] - ------------------------------------------
19:34:56.914 [main] INFO [Main.java:267] - KairosDB service started
19:34:56.915 [main] INFO [Main.java:268] - ------------------------------------------
19:34:57.142 [Thread-16] INFO [null:-1] - [KRMQ] Connecting to RabbitMQ broker.
19:34:57.147 [Thread-16] INFO [null:-1] - [KRMQ] Reading binding configuration from 'conf/bindings.json'.
19:34:57.260 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch1' to queue 'queue1' with bindingkey '#'.
19:34:57.280 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue2' with bindingkey 'color.#'.
19:34:57.295 [Thread-16] INFO [null:-1] - [KRMQ] Waiting for messages of exchange 'exch2' to queue 'queue3' with bindingkey 'size.#'.

@hugocore
Copy link
Owner

Well, it makes sense that if you clean the queue and restart Kairos you don't see that message error, because there is no message to parse. As soon there is a message in the queue to be parsed, which the plugin will then read it, processed and try to save it internally by converting it to a KairosDB DataPoint, the error will raise again.

The problem should be around this line:

DataPointSet dps = new DataPointSet(metricName);

Here's where the Consumer thread will process the message. Perhaps KairosDB changed the logic and you can no longer create DataPoints like so. With a quick search I found a Datapoint Factory here: https://github.com/kairosdb/kairosdb/blob/master/src/main/java/org/kairosdb/core/datapoints/DoubleDataPointFactoryImpl.java

I was using these at the moment of development:
import org.kairosdb.core.DataPoint;
import org.kairosdb.core.DataPointSet;
import org.kairosdb.core.datapoints.DoubleDataPoint;
import org.kairosdb.core.datapoints.LongDataPoint;

Check if using this factory class you can create the DataPoints correctly. I would appreciate the help.

@javicho21
Copy link
Author

Hi Hugo,
I am not sure how to make the changes you suggest. Can you tell me what I need to do in order to try that factory class?
Thank You

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