Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1889

Support OpenWebBeans in resteasy-cdi

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 4.0.0.Beta2
    • CDI Integration
    • None

    Description

      @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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            erik.ostlund@gmail.com Erik Östlund (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: