Coder Social home page Coder Social logo

"Multiple consumers for the same endpoint" after renaming packages in extensions/servlet/deployment/src/test/java about camel-quarkus HOT 8 CLOSED

apache avatar apache commented on June 29, 2024
"Multiple consumers for the same endpoint" after renaming packages in extensions/servlet/deployment/src/test/java

from camel-quarkus.

Comments (8)

aloubyansky avatar aloubyansky commented on June 29, 2024 1

I am going to check it out.

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

Renaming the packages in integration-tests/core like this https://github.com/ppalaga/camel-quarkus/commits/i6.3 leads to

[INFO] Running org.apache.camel.quarkus.it.core.CamelInfinispanTest
13:55:46,237 INFO  [org.inf.fac.GlobalComponentRegistry] ISPN000128: Infinispan version: Infinispan 'N/A' 10.0.0.Beta3
13:55:46,648 INFO  [org.inf.ser.hot.tes.HotRodTestingUtil] Start server in port 11232
13:55:46,672 WARN  [org.inf.man.DefaultCacheManager] ISPN000434: Direct usage of the ___defaultcache name to retrieve the default cache is deprecated
13:55:46,672 WARN  [org.inf.man.DefaultCacheManager] ISPN000454: Calling getCache with a cache override is no longer supported. Please invoke createCache first and then getCache. Cache name was default
13:55:48,036 INFO  [io.qua.dep.QuarkusAugmentor] Beginning quarkus augmentation
13:55:48,218 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Beta4
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.603 s <<< FAILURE! - in org.apache.camel.quarkus.it.core.CamelInfinispanTest
[ERROR] testInfinispan  Time elapsed: 0.027 s  <<< ERROR!
org.junit.jupiter.api.extension.TestInstantiationException: 
TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [org.apache.camel.quarkus.it.core.CamelInfinispanTest]: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.resteasy.server.common.deployment.ResteasyServerCommonProcessor#build threw an exception: java.lang.RuntimeException: Multiple classes ( org.apache.camel.quarkus.it.core.CamelApplication,org.apache.camel.quarkus.it.core.CamelApplication) have been annotated with @ApplicationPath which is currently not supported
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeTestInstanceFactory(ClassTestDescriptor.java:314)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:289)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:281)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateAndPostProcessTestInstance(ClassTestDescriptor.java:269)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstancesProvider$2(ClassTestDescriptor.java:259)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstancesProvider$3(ClassTestDescriptor.java:263)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstancesProvider$4(ClassTestDescriptor.java:262)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:98)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:97)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:68)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
        at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
        at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:170)
        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:154)
        at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
        at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:142)
        at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:117)
        at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:383)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:344)
        at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:125)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:417)
Caused by: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.resteasy.server.common.deployment.ResteasyServerCommonProcessor#build threw an exception: java.lang.RuntimeException: Multiple classes ( org.apache.camel.quarkus.it.core.CamelApplication,org.apache.camel.quarkus.it.core.CamelApplication) have been annotated with @ApplicationPath which is currently not supported
        at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:132)
        at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:241)
        at io.quarkus.test.junit.QuarkusTestExtension.createTestInstance(QuarkusTestExtension.java:311)
        at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeTestInstanceFactory(ClassTestDescriptor.java:299)
        ... 47 more
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.resteasy.server.common.deployment.ResteasyServerCommonProcessor#build threw an exception: java.lang.RuntimeException: Multiple classes ( org.apache.camel.quarkus.it.core.CamelApplication,org.apache.camel.quarkus.it.core.CamelApplication) have been annotated with @ApplicationPath which is currently not supported
        at io.quarkus.builder.Execution.run(Execution.java:108)
        at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:121)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:104)
        at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:98)
        ... 50 more
Caused by: java.lang.RuntimeException: Multiple classes ( org.apache.camel.quarkus.it.core.CamelApplication,org.apache.camel.quarkus.it.core.CamelApplication) have been annotated with @ApplicationPath which is currently not supported
        at io.quarkus.resteasy.server.common.deployment.ResteasyServerCommonProcessor.createMultipleApplicationsException(ResteasyServerCommonProcessor.java:574)
        at io.quarkus.resteasy.server.common.deployment.ResteasyServerCommonProcessor.build(ResteasyServerCommonProcessor.java:163)
        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:507)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:398)
        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:1538)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1429)
        at java.lang.Thread.run(Thread.java:748)
        at org.jboss.threads.JBossThread.run(JBossThread.java:479)

See https://travis-ci.org/ppalaga/camel-quarkus/builds/553258298?utm_source=github_status&utm_medium=notification

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

@lburgazzoli can you please assign to me?

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

Update: Debugging the first variant of the problem shows that three instances of org.apache.camel.quarkus.component.servlet.test.MinimalConfigTest.Routes get passed to org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime.setBuilders(List<RoutesBuilder>)

Clearly, there should be only one instance.

image

Let me investigate why the three are created.

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

With this tree https://github.com/ppalaga/camel-quarkus/commits/i6.4 , the MinimalConfigTest.Routes() constructor is called three times from

io.quarkus.deployment.steps.CamelInitProcessor$createInitTask8.deploy_0(CamelInitProcessor$createInitTask8.zig:52)
io.quarkus.deployment.steps.CamelInitProcessor$createInitTask8.deploy_0(CamelInitProcessor$createInitTask8.zig:68)
io.quarkus.deployment.steps.CamelInitProcessor$createInitTask8.deploy_0(CamelInitProcessor$createInitTask8.zig:84)

I assume CamelInitProcessor$createInitTask8.deploy_0 is a generated byte code. Any advice @aloubyansky how I could figure out why those three calls are generated instead of one?

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

So given that the current PR is blocked by changes that need to get merged to Quarkus (@aloubyansky may want to paste the exact PR links), I think we should merge #23 now. WDYT @lburgazzoli ?

from camel-quarkus.

lburgazzoli avatar lburgazzoli commented on June 29, 2024

See also quarkusio/quarkus#3268

from camel-quarkus.

ppalaga avatar ppalaga commented on June 29, 2024

The issue is solved after upgrading to Quarkus 0.20.0, all test packages will be renamed after #103 is merged. I think we can close this one.

from camel-quarkus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.