Confluent 3.0 quick start -- get error when trying to send message

986 views
Skip to first unread message

Hongwei Wang

unread,
May 31, 2016, 3:45:49 PM5/31/16
to Confluent Platform
I have tried to follow the quick steps to get the new version working...


When I get every servers up, and tried to send message by following command below

$ ./bin/kafka-avro-console-producer \
         --broker-list localhost:9092 --topic test \
         --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}'
tried to input message:
{"f1": "value1"}
{"f1": "value2"}
{"f1": "value3"}
but I always get error as below:
org.apache.kafka.common.errors.SerializationException: Error serializing Avro message
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
 at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@312aa7c; line: 1, column: 1]
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
	at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3609)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3549)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2657)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.sendHttpRequest(RestService.java:150)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.httpRequest(RestService.java:181)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:232)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:224)
	at io.confluent.kafka.schemaregistry.client.rest.RestService.registerSchema(RestService.java:219)
	at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.registerAndGetId(CachedSchemaRegistryClient.java:57)
	at io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient.register(CachedSchemaRegistryClient.java:89)
	at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:72)
	at io.confluent.kafka.formatter.AvroMessageReader.readMessage(AvroMessageReader.java:158)
	at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:55)
	at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
Could someone help me to find the reason? many thanks
Regards
Hongwei

Dustin Cote

unread,
May 31, 2016, 4:01:13 PM5/31/16
to confluent...@googlegroups.com
Hi Hongwei,

Have you tried sending each line individually?  Just try producing "{"f1": "value1"}" and see if that works? The message looks like you have a malformed avro message, so this simpler message could help debug.

Regards,

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.
To post to this group, send email to confluent...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/1aa28db3-4886-4901-ad4c-ecaf30f93012%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dustin Cote

Hongwei Wang

unread,
May 31, 2016, 4:36:39 PM5/31/16
to Confluent Platform
Thank you for helping...

Yes, I input single line..."{"f1": "value1"}"  as shown below...

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

{"f1": "value1"}

org.apache.kafka.common.errors.SerializationException: Error serializing Avro message

Caused by: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input

 at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@312aa7c; line: 1, column: 1]

at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)

at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3609)

To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.



--
Dustin Cote

Dustin Cote

unread,
Jun 1, 2016, 3:23:13 PM6/1/16
to confluent...@googlegroups.com
Hi Hongwei,

Are you able to perform the steps in the schema registry quickstart?

It seems to me that something is malformed in your avro message here, so if you can perform the steps in the schema registry quickstart, that can help isolate the issue.

Thanks,

To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.



--
Dustin Cote

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platf...@googlegroups.com.

To post to this group, send email to confluent...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Dustin Cote

VISHAL AGRAWAL

unread,
Oct 26, 2016, 11:34:11 AM10/26/16
to Confluent Platform
I am also facing the same issue. Did anyone get the resolution for this issue?

- Thanks

Ci-Ci Thomson

unread,
Mar 23, 2017, 11:17:52 AM3/23/17
to Confluent Platform
Has this been resolved?  I have the same exception with the 3.2 quickstart.  I am only putting one message {"f1":"value1"} and hitting <Enter> on the same line.

Gwen Shapira

unread,
Mar 24, 2017, 4:53:43 PM3/24/17
to confluent...@googlegroups.com
I can't reproduce the issue, but I suspect it may be caused by a different version of Jackson that is in your classpath.

Do you have your classpath set to anything before running the console producer?
If so, can you set it to empty and try running again?

Gwen

--
You received this message because you are subscribed to the Google Groups "Confluent Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to confluent-platform+unsub...@googlegroups.com.
To post to this group, send email to confluent-platform@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/confluent-platform/69828956-8f29-4e60-b5be-f6dee553ab8c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Gwen Shapira
Product Manager | Confluent
650.450.2760 @gwenshap
Follow us: Twitter | blog

Message has been deleted

Cauchy Wu

unread,
May 18, 2018, 8:19:32 PM5/18/18
to Confluent Platform
I see some of you guys have this issue too, but seems like no answer on Internet.


Below is how I fix the issue:

Check your schema-registry url in  ${confluent_install_path}/etc/schema-registry/schema-registry.properties

if your schema-registry is not like localhost:8081,  you will definitely have the issue because by default,  ${confluent_install_path}/bin/kafka-avro-console-producer use localhost:8081.

for example, my schema-registry server is wdsjnl010:8089
then I go to wdsjnl010 to make sure my schema-registry service up and running. 

Edit your kafka-avro-console-producer
vim ./bin/kafka-avro-console-producer

replace to "schema.registry.url=http://localhost:8081" to "schema.registry.url=http://wdsjnl010:8089"

then you can try to produce data again. It is fixed my issue.

And you need to fix the same thing in kafka-avro-console-consumer if you want to consume the data.


在 2016年6月1日星期三 UTC+8上午3:45:49,Hongwei Wang写道:
Reply all
Reply to author
Forward
0 new messages