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

camel-quarkus-netty-http failing to boot #454

Closed
peteroyle opened this issue Nov 21, 2019 · 5 comments
Closed

camel-quarkus-netty-http failing to boot #454

peteroyle opened this issue Nov 21, 2019 · 5 comments

Comments

@peteroyle
Copy link

peteroyle commented Nov 21, 2019

Hi,

I upgraded from Quarkus 1.0.0.CR1 to 1.0.0.CR2 and got the error below. By removing dependencies from the pom.xml I narrowed it down to camel-quarkus-netty-http. I then reproduced it by generating a fresh Quarkus project via https://code.quarkus.io and choosing just:

[x] RESTEasy JAX-RS
[x] Camel Quarkus Netty HTTP

Output of ./mvnw clean install on that fresh project (on MacOS 10.15.1, Java 1.8.0_232):

--- Downloads/code-with-quarkus » ./mvnw clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ code-with-quarkus ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Users/peteroyle/Downloads/code-with-quarkus/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/peteroyle/Downloads/code-with-quarkus/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/peteroyle/Downloads/code-with-quarkus/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ code-with-quarkus ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.acme.ExampleResourceTest
10:14:57,734 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Final
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.018 s <<< FAILURE! - in org.acme.ExampleResourceTest
[ERROR] testHelloEndpoint  Time elapsed: 0.009 s  <<< ERROR!
org.junit.jupiter.api.extension.TestInstantiationException:
TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [org.acme.ExampleResourceTest]: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.vertx.core.deployment.VertxCoreProcessor#eventLoop threw an exception: java.lang.IllegalArgumentException: Build item class must be leaf (final) types: class io.quarkus.netty.deployment.EventLoopSupplierBuildItem
	at io.quarkus.builder.item.BuildItem.<init>(BuildItem.java:22)
	at io.quarkus.builder.item.SimpleBuildItem.<init>(SimpleBuildItem.java:10)
	at io.quarkus.netty.deployment.EventLoopSupplierBuildItem.<init>(EventLoopSupplierBuildItem.java:13)
	at io.quarkus.vertx.core.deployment.VertxCoreProcessor.eventLoop(VertxCoreProcessor.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Caused by: java.lang.RuntimeException:
io.quarkus.builder.BuildException: Build failure: Build failed due to errors
	[error]: Build step io.quarkus.vertx.core.deployment.VertxCoreProcessor#eventLoop threw an exception: java.lang.IllegalArgumentException: Build item class must be leaf (final) types: class io.quarkus.netty.deployment.EventLoopSupplierBuildItem
	at io.quarkus.builder.item.BuildItem.<init>(BuildItem.java:22)
	at io.quarkus.builder.item.SimpleBuildItem.<init>(SimpleBuildItem.java:10)
	at io.quarkus.netty.deployment.EventLoopSupplierBuildItem.<init>(EventLoopSupplierBuildItem.java:13)
	at io.quarkus.vertx.core.deployment.VertxCoreProcessor.eventLoop(VertxCoreProcessor.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Caused by: io.quarkus.builder.BuildException:
Build failure: Build failed due to errors
	[error]: Build step io.quarkus.vertx.core.deployment.VertxCoreProcessor#eventLoop threw an exception: java.lang.IllegalArgumentException: Build item class must be leaf (final) types: class io.quarkus.netty.deployment.EventLoopSupplierBuildItem
	at io.quarkus.builder.item.BuildItem.<init>(BuildItem.java:22)
	at io.quarkus.builder.item.SimpleBuildItem.<init>(SimpleBuildItem.java:10)
 1 pom.xml                                                                                                                   Buffers
	at io.quarkus.netty.deployment.EventLoopSupplierBuildItem.<init>(EventLoopSupplierBuildItem.java:13)
	at io.quarkus.vertx.core.deployment.VertxCoreProcessor.eventLoop(VertxCoreProcessor.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Caused by: java.lang.IllegalArgumentException: Build item class must be leaf (final) types: class io.quarkus.netty.deployment.EventLoopSupplierBuildItem

[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR]   ExampleResourceTest.testHelloEndpoint » TestInstantiation TestInstanceFactory ...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.589 s
[INFO] Finished at: 2019-11-21T10:14:58+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project code-with-quarkus: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/peteroyle/Downloads/code-with-quarkus/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
@ppalaga
Copy link
Contributor

ppalaga commented Nov 21, 2019

Thanks for the report, let me try to reproduce.

@ppalaga
Copy link
Contributor

ppalaga commented Nov 21, 2019

Yes, I can reproduce.

As a workaround, you can downgrade to quarkus 1.0.0.CR1 by changing the following props in your pom.xml:

    <quarkus-plugin.version>1.0.0.CR1</quarkus-plugin.version>
    <quarkus.platform.version>1.0.0.CR1</quarkus.platform.version>

@ppalaga
Copy link
Contributor

ppalaga commented Nov 21, 2019

Observations:

  • The EventLoopSupplierBuildItem is made final in Quarkus 1.0.0.CR2 while it is still broken in CR1.
  • The Universe BOM pulls camel-quarkus-netty 0.4.0 which depends on quarkus-netty 1.0.0.CR1 - that's how the bad version comes into the play.
  • The Maven compile class path of the reproducer project contains the correct quarkus-netty version 1.0.0.CR2

So I guess it is probably the quarkus-maven-plugin that does not respect the dependency resolution done in the universe pom and pulls the wrong version of quarkus-netty-deployment.

@ppalaga
Copy link
Contributor

ppalaga commented Nov 21, 2019

quarkus-maven-plugin probably relies on quarkus-universe-bom-deployment and the root cause seems to be there: it imports camel-quarkus-parent instead of camel-quarkus-bom-deployment
https://github.com/quarkusio/quarkus-platform/blob/1.0.0.CR2/bom/deployment/pom.xml#L40
Let me ask the universe guys about that.

@peteroyle
Copy link
Author

I'm using 1.0.0.Final now and this bug is no longer present. Thanks, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants