-
1. Re: Getting set up--Newbie
gzoller.greg.zoller.aviall.com Aug 11, 2009 5:19 PM (in response to gzoller.greg.zoller.aviall.com)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?)
Thanks,
Greg -
2. Re: Getting set up--Newbie
nickarls Aug 12, 2009 9:45 AM (in response to gzoller.greg.zoller.aviall.com)And you have the beans.xml file present? Do you see the beans boot up in the log?
You might want to do
ant update
in the jboss-as dir of Web Beans. Unless the deployer is still broken ;-) Check with Pete -
3. Re: Getting set up--Newbie
gzoller.greg.zoller.aviall.com Aug 13, 2009 12:31 AM (in response to gzoller.greg.zoller.aviall.com)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. :-)