Reputation: 46876
I have Weld SE, bootstraped this way:
WeldContainer weld = new Weld().initialize();
And the following bean
@ApplicationScoped
public class EntityManagerStoreImpl implements EntityManagerStore {
static { System.out.println(" AAAAAA EMSI static"); }
public EntityManagerStoreImpl() {
System.out.println(" AAAAAA EMSI constructor");
}
public void init( @Observes ContainerInitialized containerInitialized ) {
System.out.println(" AAAAAA EMSI init");
}
...
}
According to Weld docs, the init()
method should be called.
But it's not. Other beans are working fine.
What can be wrong?
Upvotes: 2
Views: 1391
Reputation: 46876
Oh... I should have read the docs more carefuly.
ContainerInitialized
is currently only fired from StartMain helper class.
I don't like that, I'd expect it to be fired from Weld.initialize()
.
So I created https://issues.jboss.org/browse/WELD-949
(Pls vote if you share this oppinion with me.)
Upvotes: 4