Change the JSONObject import to
import org.apache.storm.shade.org.json.simple.JSONObject;
Resolved.
The missing exception stack information quiet misleads me !
2016-11-17 12:38 GMT+08:00 Zhechao Ma :
> I modify code in KafkaProducer.java to catch the exception stack, and
> finally get the re
I modify code in KafkaProducer.java to catch the exception stack, and
finally get the real Exception cause.
java.lang.ClassCastException:
org.apache.storm.shade.org.json.simple.JSONObject cannot be cast to
org.json.simple.JSONObject
So this problem is related to the maven shade plugin.
2016-11-
Hi Amber,
Here is the code.
Properties prop = new Properties();
prop.put("bootstrap.servers", kafkaBrokers);
prop.put("ack", ack);
prop.put("key.serializer", keySerializer);
prop.put("value.serializer", valueSerializer);
KafkaBolt kafkaBolt = new KafkaBolt()
.withProducerProperti
Hey,
You want to post json string to kafka right ?
Also can you post code you are using to post to kafka.
On Tue, Nov 15, 2016 at 12:18 PM, Zhechao Ma
wrote:
> Here is the code. I can only get log in the constructor and configure
> method.
>
> import org.json.simple.JSONObject;
> import org.apa
Here is the code. I can only get log in the constructor and configure method.
import org.json.simple.JSONObject;import
org.apache.kafka.common.errors.SerializationException;import
org.apache.kafka.common.serialization.Serializer;
import java.util.Map;import org.slf4j.Logger;import org.slf4j.Logge
unsubscribe
2016-11-14 20:01 GMT+08:00 Andrew Xor :
> Hi,
>
> Since you can't cast one type to another and you are not getting a Null
> exception in order to be better able to help you could you give us the
> implementation of your serializer?
>
> Cheers,
>
> A.
>
> On Mon, Nov 14, 2016 at 9:17
Hi,
Since you can't cast one type to another and you are not getting a Null
exception in order to be better able to help you could you give us the
implementation of your serializer?
Cheers,
A.
On Mon, Nov 14, 2016 at 9:17 AM, Zhechao Ma
wrote:
> Even when I implement my own json serializer,
Even when I implement my own json serializer, it still throws the similar
exception, but no more details for debug.:
org.apache.kafka.common.errors.SerializationException: Can't convert value
of class org.apache.storm.shade.org.json.simple.JSONObject to xx
specified in value.serializer
I add
I'm using KafkaBolt to write data to kafka. Tuple to kafka map is .
I set both *key.serializer* and *value.serializer* as
"org.apache.kafka.common.serialization.StringSerializer". I get the
following Exception:
org.apache.kafka.common.errors.SerializationException: Can't convert value
of class org