Hi Emily, you will need to trick Weld into thinking the listener comes from deployment and therefore inject the right BeanManager into the beanManager field. This is done by adding the listener class to the list of classes returned from BeanDeploymentArchive.getClasses(). I realize this is not very clean thus I am going to add a constructor accepting BeanManager to WeldInitialListener in a next release. Hope that helps.
|