It seems that Pax CDI only implements explicit bean archives so far. I
filed an issue at
https://ops4j1.jira.com/browse/PAXCDI-186 You'll need
to mark classes/packages you do not want discovered with @Vetoed or use
an exclude filter
http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#exclude_filters
On 05/27/2015 08:55 AM, Александр Свиридов wrote:
I use weld as CDI container. Besides I use osgi (felix). So it's
javase + felix+weld+pax. I have the following beans.xml
|<?xml version="1.0" encoding="UTF-8"?><beans
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"
bean-discovery-mode="annotated"></beans>|
And I have two classes:
|@ApplicationScopedpublicclass A{@Injectprivate B b;publicvoid
postCreate(@ObservesContainerInitialized event,BundleContext ctx){
b.test();}}|
And class B
|publicclass B{publicvoid test(){System.out.println("test is here");}}|
As you see class B doesn't have any @scopes or @dependent annotations.
However when I start application object of class B is injected to
object A and method test is invoked. Why? As I understand it mustn't
be injected.
*EDIT 1*
I tried to use 1.1 version:
|<?xml version="1.0" encoding="UTF-8"?><beans
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
bean-discovery-mode="annotated"
version="1.1"></beans>|
but it didn't help.
_______________________________________________
weld-dev mailing list
weld-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-dev