Ok, I tried something slightly different but still no dice.
Trying to piece together what I'm understanding from the documentation, the Web Beans Manager can't do its injection magic on objects creating with new(), which I presume would include my EJBs created by the container, not the Manager.
So something has to bootstrap the whole
graph of dependencies and injection, right? How is this done?
Another poster talked about getting an instance of CurrentManager and use it to create a web beans instance. Presumably once a web bean is created by the Manager we're off to the races, as all other dependencies would be created/injected by the Manager.
So I tried this:
Manager manager = CurrentManager.rootManager(); if( manager == null ) System.out.println("!!!!!!!!! Null manager"); else masterRegistry = (Foo) manager.getInstanceByName("Foo");
Unfortunately this produced a null Manager instance.
How can I bootstrap this thing so my injections will work? If this code is correct, and the approach ok, then is the likely problem in the out-of-the-box JBoss 5.1.0 installation? I did have to copy the file webbeans-core.jar into JBoss' deployers/webbeans.deployer directory for the build path to pick up on CurrentManager. (This directory is missing a lot of files present in the webbeans preview lib dir--is that important?)
And you have the beans.xml file present? Do you see the beans boot up in the log?
You might want to do
ant updatein the jboss-as dir of Web Beans. Unless the deployer is still broken ;-) Check with Pete
Ahh...That was it. Putting a beans.xml in my META-INF directory caused the server to attempt to load the beans. Thank you!
I'm now past this problem and on to the next. :-)