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

Update to 2.0.1.Final breaks working Kafka deserializer configuration in 1.x #18495

Closed
j1cken opened this issue Jul 7, 2021 · 4 comments · Fixed by #18523
Closed

Update to 2.0.1.Final breaks working Kafka deserializer configuration in 1.x #18495

j1cken opened this issue Jul 7, 2021 · 4 comments · Fixed by #18523
Assignees
Labels
area/kafka kind/bug Something isn't working
Milestone

Comments

@j1cken
Copy link

j1cken commented Jul 7, 2021

Describe the bug

Changing pom.xml from 1.x to 2.0.1.Final prevents successful Dev Mode startup with exception.

Expected behavior

No errors during startup like before with 1.x

Actual behavior

Exception during startup is thrown:

2021-07-07 17:06:06,364 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.deployment.steps.ConfigGenerationBuildStep#generateConfigClass threw an exception: java.lang.IllegalStateException: More than one default value for mp.messaging.incoming.created.value.deserializer was produced
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.generateConfigClass(ConfigGenerationBuildStep.java:64)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:414)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:274)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:66)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:87)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:448)
	at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:61)
	at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:132)
	at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:89)
	at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:145)
	at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.deployment.steps.ConfigGenerationBuildStep#generateConfigClass threw an exception: java.lang.IllegalStateException: More than one default value for mp.messaging.incoming.created.value.deserializer was produced
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.generateConfigClass(ConfigGenerationBuildStep.java:64)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

	at io.quarkus.builder.Execution.run(Execution.java:116)
	at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
	at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:156)
	at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:412)
	... 9 more
Caused by: java.lang.IllegalStateException: More than one default value for mp.messaging.incoming.created.value.deserializer was produced
	at io.quarkus.deployment.steps.ConfigGenerationBuildStep.generateConfigClass(ConfigGenerationBuildStep.java:64)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
	at java.base/java.lang.Thread.run(Thread.java:829)
	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

To Reproduce

Could not reproduce with quarkus-quickstarts/kafka-panache-reactive-quickstart, but there isn't any quickstart utilising deserializers.

Configuration

according to Serializing via JSON-B

# Add your application.properties here, if applicable.
# Configure the Kafka sink (we write to it)
mp.messaging.outgoing.entry-created.connector=smallrye-kafka
mp.messaging.outgoing.entry-created.topic=created
mp.messaging.outgoing.entry-created.value.serializer=io.quarkus.kafka.client.serialization.JsonbSerializer

# Configure the Kafka source (we read from it)
mp.messaging.incoming.created.connector=smallrye-kafka
mp.messaging.incoming.created.topic=created
mp.messaging.incoming.created.broadcast=true
mp.messaging.incoming.created.value.deserializer=me.cligg.dto.MyCacheEntryDeserializer

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

Linux fedora 5.12.13-300.fc34.x86_64 #1 SMP Wed Jun 23 16:18:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)

GraalVM version (if different from Java)

Quarkus version or git rev

<quarkus-plugin.version>2.0.1.Final</quarkus-plugin.version>
<quarkus.platform.version>2.0.1.Final</quarkus.platform.version>

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/torben/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-4.fc34.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.12.13-300.fc34.x86_64", arch: "amd64", family: "unix"

Additional context

(Add any other context about the problem here.)

@j1cken j1cken added the kind/bug Something isn't working label Jul 7, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 7, 2021

/cc @cescoffier

@cescoffier
Copy link
Member

Sounds like a bug in the auto-detection of the serde.

@ozangunalp
Copy link
Contributor

Hi @j1cken,

Thanks for creating this issue. I was able to reproduce it.
While we prepare and release the fix you can disable the serde auto-detection by adding quarkus.reactive-messaging.kafka.serializer-autodetection.enabled=false to your config file.

ozangunalp added a commit to ozangunalp/quarkus that referenced this issue Jul 8, 2021
Multiple annotations for the same channel causes duplicate default configs
ozangunalp added a commit to ozangunalp/quarkus that referenced this issue Jul 8, 2021
@j1cken
Copy link
Author

j1cken commented Jul 8, 2021

Workaround confirmed!

quarkus.reactive-messaging.kafka.serializer-autodetection.enabled=false

@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jul 8, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.2.Final Jul 12, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 12, 2021
Multiple annotations for the same channel causes duplicate default configs

(cherry picked from commit a906fe2)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 12, 2021
… state, avoid duplicates.

Fixes quarkusio#18495

(cherry picked from commit 366573d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kafka kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants