cdiapache-tomeeweld

Problem when deploying PF 11 app with CDI (weld) on Tomee Plume 8.0.9


I'm trying to migrate a PF6 app to PF11, and, after deploying it on tomee 8.0.9, I've got the following error:

            Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
                ... 37 more
        Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type GeronimoOpenAPIExtension with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIFilter.extension
  at org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIFilter.extension(OpenAPIFilter.java:0)
  Possible dependencies: 
  - Extension [class org.apache.geronimo.microprofile.openapi.cdi.GeronimoOpenAPIExtension] with qualifiers [@Default]; jar:file:/home/chiritda/Software/ntv_3.0/apache-tomee-plume-8.0.9/lib/geronimo-openapi-impl-1.0.12.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[org.apache.geronimo.microprofile.openapi.cdi.GeronimoOpenAPIExtension@10c433f7],
  - Extension [class org.apache.tomee.microprofile.config.TomEEOpenAPIExtension] with qualifiers [@Default]; jar:file:/home/chiritda/Software/ntv_3.0/apache-tomee-plume-8.0.9/lib/mp-common-8.0.9.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@17[org.apache.tomee.microprofile.config.TomEEOpenAPIExtension@a21441e]

                at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:386)
                at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290)
                at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143)
                at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164)
                at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526)
                at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64)
                at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62)
                at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)
                at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
                at java.base/java.lang.Thread.run(Thread.java:833)

Both Geronimo and TomeeOpenApi extensions are present in the tomee's lib directory.

I'm using a standalone tomee plume server, java 17.0.1, PF11, WELD 3.1.4.

Any ideas would be appreciated.

Thanks!


Solution

  • Moving this to an answer :)

    You should not be using Weld as TomEE includes OpenWebBeans. You now have two implementations of the same thing (CDI) and likely that is causing strange issues.