manub / scalatest-embedded-kafka

A library that provides an in-memory Kafka instance to run your tests against.
MIT License
295 stars 87 forks source link

Schema registry missing class #142

Closed aig787 closed 2 years ago

aig787 commented 6 years ago

Kafka fails to start with embedded schema registry with the following error. Running the same code with EmbeddedKafkaConfig instead of EmbeddedKafkaConfigWithSchemaRegistry allows Kafka to start normally.

09:35:52.238 [ScalaTest-run-running-AvroSerdeTest] ERROR o.a.zookeeper.server.ZooKeeperServer - ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes
09:35:52.787 [ScalaTest-run-running-AvroSerdeTest] WARN  k.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/gv/xmthgtn10ld6c4zntpyfhx700000gn/T/kafka5424540063163778361.tmp/meta.properties
09:35:53.286 [ScalaTest-run-running-AvroSerdeTest] WARN  k.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/gv/xmthgtn10ld6c4zntpyfhx700000gn/T/kafka5424540063163778361.tmp/meta.properties
09:35:53.580 [ScalaTest-run-running-AvroSerdeTest] WARN  io.confluent.rest.Application - DEPRECATION warning: `listeners` configuration is not configured. Falling back to the deprecated `port` configuration.
09:35:53.737 [ScalaTest-run-running-AvroSerdeTest] WARN  io.confluent.rest.Application - DEPRECATION warning: `listeners` configuration is not configured. Falling back to the deprecated `port` configuration.
09:35:53.754 [ScalaTest-run-running-AvroSerdeTest-SendThread(localhost:57670)] WARN  org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
09:35:53.892 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.admin.AdminClientConfig - The configuration 'topic' was supplied but isn't a known config.
09:35:53.893 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.admin.AdminClientConfig - The configuration 'connection.url' was supplied but isn't a known config.
09:35:54.016 [ScalaTest-run-running-AvroSerdeTest] WARN  i.c.k.s.storage.KafkaStore - Creating the schema topic _schemas using a replication factor of 1, which is less than the desired one of 3. If this is a production environment, it's crucial to add more brokers and increase the replication factor of the topic.
09:35:54.222 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.producer.ProducerConfig - The configuration 'topic' was supplied but isn't a known config.
09:35:54.222 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.producer.ProducerConfig - The configuration 'connection.url' was supplied but isn't a known config.
09:35:54.254 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.consumer.ConsumerConfig - The configuration 'topic' was supplied but isn't a known config.
09:35:54.255 [ScalaTest-run-running-AvroSerdeTest] WARN  o.a.k.c.consumer.ConsumerConfig - The configuration 'connection.url' was supplied but isn't a known config.
09:35:54.423 [ScalaTest-run-running-AvroSerdeTest-SendThread(localhost:57670)] WARN  org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
09:35:54.639 [ScalaTest-run-running-AvroSerdeTest] WARN  io.confluent.rest.Application - DEPRECATION warning: `listeners` configuration is not configured. Falling back to the deprecated `port` configuration.
09:35:54.685 [ScalaTest-run-running-AvroSerdeTest] ERROR o.a.zookeeper.server.ZooKeeperServer - ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes

A needed class was not found. This could be due to an error in your runpath. Missing class: org/eclipse/jetty/server/handler/ContextHandler$NoContext
java.lang.NoClassDefFoundError: org/eclipse/jetty/server/handler/ContextHandler$NoContext
    at org.eclipse.jetty.servlet.ServletContextHandler.newServletHandler(ServletContextHandler.java:260)
    at org.eclipse.jetty.servlet.ServletContextHandler.getServletHandler(ServletContextHandler.java:322)
    at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:198)
    at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:157)
    at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:117)
    at org.eclipse.jetty.servlet.ServletContextHandler.<init>(ServletContextHandler.java:105)
    at io.confluent.rest.Application.createServer(Application.java:267)
    at io.confluent.kafka.schemaregistry.RestApp.start(RestApp.java:76)
    at net.manub.embeddedkafka.schemaregistry.EmbeddedKafkaWithSchemaRegistrySupport.startSchemaRegistry(embeddedKafkaWithSchemaRegistry.scala:122)
    at net.manub.embeddedkafka.schemaregistry.EmbeddedKafkaWithSchemaRegistrySupport.startSchemaRegistry$(embeddedKafkaWithSchemaRegistry.scala:111)
    at net.manub.embeddedkafka.schemaregistry.EmbeddedKafkaWithSchemaRegistrySupport.$anonfun$withRunningKafkaOnFoundPort$2(embeddedKafkaWithSchemaRegistry.scala:88)
    at net.manub.embeddedkafka.EmbeddedKafkaSupport.withTempDir(EmbeddedKafka.scala:265)
    at net.manub.embeddedkafka.EmbeddedKafkaSupport.withTempDir$(EmbeddedKafka.scala:261)

sbt dependency entry

"net.manub" %% "scalatest-embedded-schema-registry" % "1.1.0-kafka1.1-nosr" % Test,

blissd commented 6 years ago

I also see this problem.

manub commented 6 years ago

This may be related to incompatible versions of Jetty on your classpath. If you run something like sbt dependencyTree what's the ouptut for Jetty?