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

Spurious BeanManagerProvider warnings when used in EAR

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.4
    • 0.5
    • Core
    • None
    • JBoss AS 7.2.0.Final (EAP 6.1.0.Alpha1)

    Description

      BeanManagerProvider spams the log with this warning, long after the container has been started:
      "When using the BeanManager to retrieve Beans before the Container is started, non-portable behaviour results!"

      The problem appears to be caused by having deltaspike-core-api in the EAR /lib directory and using BeanManagerProvider from inside a WAR module. The warning gets printed when the booted flag for the appropriate BeanManagerInfo is false, and BeanManagerInfo instances initialize it to false when they are created. The only place the booted flag gets changed to true is in cleanupFinalBeanManagers(), which iterates over all the BeanManagerInfo instances that exist at the time it is called.

      In my case, the only BeanManagerInfo that exists when cleanupFinalBeanManagers() is called is the one that was created when the setBeanManager() observer method was called by the container. But the classloader in use when setBeanManager() was called was the classloader for the entire EAR. Because I don't attempt to use BeanManagerProvider until after cleanupFinalBeanManagers() is called, this means that the BeanManagerInfo for the WAR classloader is created with the booted flag set to false (which is incorrect) and the flag is never changed to true.

      Attachments

        Activity

          People

            struberg Mark Struberg
            rcd Richard DiCroce
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: