Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-3632

SwitchYard injection does not work in @PostConstruct method of Service bean

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • jboss-fuse-6.2.1
    • jboss-fuse-6.2
    • SwitchYard
    • None

    Description

      As described by Keith:

      "You can't use SY injection in @PostConstruct, for references, properties, or anything else. The reason why is that the CDI lifecycle is separate from the SY deployment lifecycle and at the time PostConstruct is called, the SY deployment lifecycle has not completed."

      This still needs to be addressed though.

      Version-Release number of selected component (if applicable):

      FSW 6.0.0

      How reproducible:
      always

      Steps to Reproduce: properties example

      1. Create SY property
      2. Try to obtain its value in the @PostConstruct method
      3. Deploy the application - the value is null

      Actual results:

      The value of injected property is null in the @PostConstruct method

      Expected results:

      The value is properly injected and retrieved.

      Additional info:

      I am attaching

      • test project which can be used for testing, you can use it like
      • mvn clean package jboss-as:deploy — FSW needs to be running
      • mvn exec:java

      I have also attached tests I have done so far.

      Attachments

        Activity

          People

            tcunning@redhat.com Thomas Cunningham
            tcunning@redhat.com Thomas Cunningham
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: