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

reactive-messaging-kafka: CNFE: io.quarkus.netty.runtime.NettyTemplate #2548

Closed
michalszynkiewicz opened this issue May 21, 2019 · 9 comments · Fixed by #2551
Closed

reactive-messaging-kafka: CNFE: io.quarkus.netty.runtime.NettyTemplate #2548

michalszynkiewicz opened this issue May 21, 2019 · 9 comments · Fixed by #2551
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@michalszynkiewicz
Copy link
Member

Describe the bug
A project with quarkus-smallrye-reactive-messaging-kafka and quarkus-smallrye-reactive-messaging works fine in the quarkus:dev mode but fails to start from jar.
Also fails to build to a native image.

Expected behavior
The application should start without error and it should be possible to build a native image.
Adding a dependency on quarkus-vertx solves the problem.
I think it may be that the dependency on quarkus-vertx is missing from quarkus-smallrye-reactive-messaging-kafka. There is a dependency between the deployment modules.

Actual behavior
The following exception is thrown when the jar is executed:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
Caused by: java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl1.<clinit>(Unknown Source)
        ... 1 more
Caused by: java.lang.NoClassDefFoundError: io/quarkus/netty/runtime/NettyTemplate
        at io.quarkus.deployment.steps.NettyProcessor$createExecutors2.deploy(Unknown Source)
        ... 2 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.netty.runtime.NettyTemplate
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 3 more

To Reproduce
Steps to reproduce the behavior:

  1. generate a project
  2. add quarkus-smallrye-reactive-messaging-kafka
  3. add quarkus-smallrye-reactive-messaging
  4. build with mvn clean package
  5. execute with java -jar target/-runner.jar

Configuration

# Add your application.properties here, if applicable.
smallrye.messaging.sink.queries.type=io.smallrye.reactive.messaging.kafka.Kafka
smallrye.messaging.sink.queries.topic=queries
smallrye.messaging.sink.queries.bootstrap.servers=localhost:9092
smallrye.messaging.sink.queries.key.serializer=org.apache.kafka.common.serialization.StringSerializer
smallrye.messaging.sink.queries.value.serializer=org.apache.kafka.common.serialization.StringSerializer
smallrye.messaging.sink.queries.acks=1

Environment (please complete the following information):

  • Output of uname -a or ver: Linux t580 5.0.16-200.fc29.x86_64 Switch to the Maven distributed copy of the SubstrateVM annotations #1 SMP Tue May 14 18:27:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  • Output of java -version: Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
  • GraalVM version (if different from Java): 1.0.0-rc15
  • Quarkus version or git rev: master
@michalszynkiewicz michalszynkiewicz added the kind/bug Something isn't working label May 21, 2019
@cescoffier cescoffier self-assigned this May 22, 2019
@cescoffier
Copy link
Member

Can you try to add the quarkus-vertx extension and if you still have an issue the, smallrye-reactive-stream-operators extension?

@cescoffier
Copy link
Member

Don't worry, I've reproduced it... Fix on its way.

@michalszynkiewicz
Copy link
Member Author

michalszynkiewicz commented May 22, 2019

Adding quarkus-vertx works around the problem, yes.

I see there's a problem with the issue templates, the description gets so long that it's not easy to read all of it ;)

@cescoffier
Copy link
Member

at the same time, I'm fixing a native build issue.

cescoffier added a commit to cescoffier/quarkus that referenced this issue May 22, 2019
Missing dependency in the reactive messaging extension
Missing dependency in the kafka connector (require during the native build)
@cescoffier
Copy link
Member

Can you check #2551?

@rsvoboda
Copy link
Member

@cescoffier any idea why quarkus:dev worked fine ?

@michalszynkiewicz can you share your sample app ?

@rsvoboda
Copy link
Member

kafka-quickstart doesn't reveal the problem as it has explicit dependency on quarkus-vertx

@rsvoboda
Copy link
Member

Plus there is quarkusio/quarkus-quickstarts#145

@michalszynkiewicz
Copy link
Member Author

@rsvoboda the simplest possible reproducer: https://github.com/michalszynkiewicz/quarkus-kafka-error-reproducer
It's enough to build the project to observe the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants