Uploaded image for project: 'SwitchYard'
  1. SwitchYard
  2. SWITCHYARD-222

CDI bean deployment @Reference injection failure on subsequent SwitchYard app deployments

    XMLWordPrintable

Details

    Description

      Background... 2 switchyard deployments. First deployment has multiple beans with an @Reference service injection point in one of the beans, injecting a reference to the other service interface. When you attempt to deploy the second switchyard deployment, it fails during the weld deployment validation phase with an error that the injection point in the first deployment (remember... we're now deploying the second deployment) can not be resolved.

      I dug into this with a debugger and I see the following....

      When the 1st deployment is being deployed, the SwitchYard CDI extension receives all of the appropriate ProcessBean @Observes events from the weld bootstrap BeanDeployer. This triggers the addition of the SwitchYard client proxy beans for the injection point and the weld validation phase passes successfully.

      When the 2nd deployment is being deployed, the WeldBootstrap class seems to go through the same process again for all deployments... loading all the classes, creating the beans, deploying them etc. This time however, when processing the deployment for the first deployment (containing the injection points), it doesn't seem to fire the ProcessBean @Observes events for the beans, resulting in a situation where the SwitchYard client proxy is never created for the injection point, resulting in the failure during the validation phase. From what I can make out... it looks like our SwitchYard CDI extension is not getting added to the BeanManager as one of the observers of the ProcessBean @Observes events, but I'm not totally sure about that.

      I've no idea why it needs to go through all this process over and over again for every BeanDeployment archive.

      Attachments

        Activity

          People

            tfennelly_jira Tom Fennelly (Inactive)
            tfennelly_jira Tom Fennelly (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: