Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-782

BeanManager lookup fails when BeanManager created in parent classloader and in SE mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.0
    • 1.2.0
    • CdiControl, Core
    • None

    Description

      using embeadded tomcat and CdiServletContextListener attempting to use BeanProvider from within a Servlet fails:

      ov 16, 2014 8:19:10 AM org.apache.catalina.core.StandardWrapperValve invoke
      SEVERE: Servlet.service() for servlet [YourServlet] in context with path [/] threw exception
      java.lang.IllegalStateException: Unable to find BeanManager. Please ensure that you configured the CDI implementation of your choice properly.
      at org.apache.deltaspike.core.api.provider.BeanManagerProvider.getBeanManager(BeanManagerProvider.java:201)
      at org.apache.deltaspike.core.api.provider.BeanProvider.getBeanManager(BeanProvider.java:475)
      at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:118)
      at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:101)

      The following code resolves fine in the same location:
      BeanManager beanManager = CdiContainerLoader.getCdiContainer().getBeanManager();

      looks like bmi.loadTimeBm at BeanManagerProvider is not being set properly when using the servlet listener

      Attachments

        Activity

          People

            struberg Mark Struberg
            shay_matasaro Shay matasaro
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: