[wildfly-dev] BeanManager usage in EAR deployments

James Netherton jnethert at redhat.com
Thu Dec 3 05:34:44 EST 2015


Hi all,

I'm using Apache Camel with its CDI component (which uses DeltaSpike). Can anyone help to clarify the behavior I see with the CDI BeanManager in the following deployment scenarios.

If I deploy my Camel application as an EAR deployment with the camel dependencies contained in the EAR archive lib directory:

- my-application.ear
  |--- lib
       |--- camel-cdi-2.16.1.jar
       |--- camel-core-2.16.1.jar
       |--- deltaspike-core-api-1.5.1.jar
       |--- deltaspike-core-impl-1.5.1.jar       
  |--- my-module.jar
       |--- META-INF
            |--- beans.xml
       |--- com.myapplication
            |--- Bootstrap.class
            |--- HelloBean.class
 
Camel is capable of resolving beans that I have annotated with @Named through this BeanManager used by the Camel CDI extension:

Weld BeanManager for my-camel-cdi-app.ear.external.jar:file:/home/james/.m2/repository/org/apache/camel/camel-cdi/2.16.1/camel-cdi-2.16.1.jar!/META-INF/beans.xml [bean count=42]

However, if I deploy an EAR with a JAR sub-deployment and modularize my Camel dependencies like this:

- my-application.ear
  |--- my-module.jar
       |--- META-INF
            |--- beans.xml
       |--- com.myapplication
            |--- Bootstrap.class
            |--- HelloBean.class
            

- module: org.apache.camel.cdi:main
|-- camel-cdi-2.16.1.jar
|-- camel-core-2.16.1.jar
|-- deltaspike-core-api-1.5.1.jar
|-- deltaspike-core-impl-1.5.1.jar

The BeanManager assigned to the Camel CDI extension is no longer capable of resolving my @Named annotated beans (HelloBean.class). Is this the expected behavior in this deployment scenario? There's some test cases which may explain things better here:

https://github.com/jamesnetherton/camel-cdi-ear-tests

Any help to clarify would be appreciated. 

Cheers,

James



More information about the wildfly-dev mailing list