-
Feature Request
-
Resolution: Cannot Reproduce
-
Major
-
None
-
4.0.0.Beta2
-
None
@Context fields are empty when combining resteasy-cdi 4.0.0.beta2 and openwebbeans 2.0.4. This is because CdiInjectorFactory.lookupBeanManagerViaServletContext looks up the BeanManager like this:
{{
public static final String BEAN_MANAGER_ATTRIBUTE_PREFIX = "org.jboss.weld.environment.servlet.";
...
beanManager = (BeanManager) servletContext.getAttribute(BEAN_MANAGER_ATTRIBUTE_PREFIX + BeanManager.class.getName());
}}
This use of a prefix works for Weld which is registered in the servlet context under org.jboss.weld.environment.servlet.javax.enterprise.inject.spi.BeanManager but not for OpenWebBeans which is registered under javax.enterprise.inject.spi.BeanManager. Possible solutions could be registering Weld javax.enterprise.inject.spi.BeanManager or performing a secondary lookup on javax.enterprise.inject.spi.BeanManager if org.jboss.weld.environment.servlet.javax.enterprise.inject.spi.BeanManager is empty.