You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On "Produce events to the input topic" section, I tried to run this command: docker exec -i schema-registry /usr/bin/kafka-avro-console-producer --topic publications --bootstrap-server broker:9092 --property value.schema="$(< src/main/avro/publication.avsc)"
This is the error:
_[2024-03-20 07:14:22,648] ERROR Could not parse Avro schema (io.confluent.kafka.schemaregistry.avro.AvroSchemaProvider)
org.apache.avro.SchemaParseException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"$(cat src/main/avro/publication.avsc)"; line: 1, column: 2]
at org.apache.avro.Schema$Parser.parse(Schema.java:1435)
at org.apache.avro.Schema$Parser.parse(Schema.java:1421)
at io.confluent.kafka.schemaregistry.avro.AvroSchema.(AvroSchema.java:76)
at io.confluent.kafka.schemaregistry.avro.AvroSchemaProvider.parseSchemaOrElseThrow(AvroSchemaProvider.java:53)
at io.confluent.kafka.schemaregistry.SchemaProvider.parseSchema(SchemaProvider.java:77)
at io.confluent.kafka.schemaregistry.SchemaProvider.parseSchema(SchemaProvider.java:86)
at io.confluent.kafka.formatter.SchemaMessageReader.parseSchema(SchemaMessageReader.java:221)
at io.confluent.kafka.formatter.SchemaMessageReader.getSchema(SchemaMessageReader.java:233)
at io.confluent.kafka.formatter.SchemaMessageReader.init(SchemaMessageReader.java:162)
at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:42)
at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"$(cat src/main/avro/publication.avsc)"; line: 1, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:745)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2961)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.handleOddValue(ReaderBasedJsonParser.java:2002)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:802)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2935)
at org.apache.avro.Schema$Parser.parse(Schema.java:1433)
... 10 more
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148)
at io.confluent.kafka.formatter.SchemaMessageReader.parseSchema(SchemaMessageReader.java:221)
at io.confluent.kafka.formatter.SchemaMessageReader.getSchema(SchemaMessageReader.java:233)
at io.confluent.kafka.formatter.SchemaMessageReader.init(SchemaMessageReader.java:162)
at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:42)
at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
How to solve this problem?
Thank you in advance for answering! :)
The text was updated successfully, but these errors were encountered:
Hi,
I encountered an error when I tried this tutorial "How to filter a stream of events" using Kafka Streams.
Link: https://developer.confluent.io/tutorials/filter-a-stream-of-events/kstreams.html
On "Produce events to the input topic" section, I tried to run this command:
docker exec -i schema-registry /usr/bin/kafka-avro-console-producer --topic publications --bootstrap-server broker:9092 --property value.schema="$(< src/main/avro/publication.avsc)"
This is the error:
_[2024-03-20 07:14:22,648] ERROR Could not parse Avro schema (io.confluent.kafka.schemaregistry.avro.AvroSchemaProvider)
org.apache.avro.SchemaParseException: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"$(cat src/main/avro/publication.avsc)"; line: 1, column: 2]
at org.apache.avro.Schema$Parser.parse(Schema.java:1435)
at org.apache.avro.Schema$Parser.parse(Schema.java:1421)
at io.confluent.kafka.schemaregistry.avro.AvroSchema.(AvroSchema.java:76)
at io.confluent.kafka.schemaregistry.avro.AvroSchemaProvider.parseSchemaOrElseThrow(AvroSchemaProvider.java:53)
at io.confluent.kafka.schemaregistry.SchemaProvider.parseSchema(SchemaProvider.java:77)
at io.confluent.kafka.schemaregistry.SchemaProvider.parseSchema(SchemaProvider.java:86)
at io.confluent.kafka.formatter.SchemaMessageReader.parseSchema(SchemaMessageReader.java:221)
at io.confluent.kafka.formatter.SchemaMessageReader.getSchema(SchemaMessageReader.java:233)
at io.confluent.kafka.formatter.SchemaMessageReader.init(SchemaMessageReader.java:162)
at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:42)
at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token '$': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (String)"$(cat src/main/avro/publication.avsc)"; line: 1, column: 2]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:745)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser._reportInvalidToken(ReaderBasedJsonParser.java:2961)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.handleOddValue(ReaderBasedJsonParser.java:2002)
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.nextToken(ReaderBasedJsonParser.java:802)
at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2935)
at org.apache.avro.Schema$Parser.parse(Schema.java:1433)
... 10 more
java.util.NoSuchElementException: No value present
at java.base/java.util.Optional.get(Optional.java:148)
at io.confluent.kafka.formatter.SchemaMessageReader.parseSchema(SchemaMessageReader.java:221)
at io.confluent.kafka.formatter.SchemaMessageReader.getSchema(SchemaMessageReader.java:233)
at io.confluent.kafka.formatter.SchemaMessageReader.init(SchemaMessageReader.java:162)
at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:42)
at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
How to solve this problem?
Thank you in advance for answering! :)
The text was updated successfully, but these errors were encountered: