Bug 1086295

Summary: SwitchYard injection does not work in @PostConstruct method of Service bean
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Anton Giertli <agiertli>
Component: SwitchYardAssignee: Rob Cernich <rcernich>
Status: CLOSED WORKSFORME QA Contact: Jiri Sedlacek <jsedlace>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: aileenc, kejohnso, oskutka, soa-p-jira, tasato, tcunning
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-14 17:59:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
reproducer
none
tests none

Description Anton Giertli 2014-04-10 14:53:47 UTC
Created attachment 884983 [details]
reproducer

Description of problem:

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.

Comment 1 Anton Giertli 2014-04-10 14:54:10 UTC
Created attachment 884984 [details]
tests

Comment 2 Aileen 2015-03-02 16:33:13 UTC
Need to diagnose if feasible to do this.

Comment 3 tcunning 2015-07-14 17:59:46 UTC
We're moving to tracking issues in JIRA for Fuse 6.2.1.   Logged https://issues.jboss.org/browse/ENTESB-3632 to represent this issue.   Closing the BZ, work will continue at the associated JIRA.

Comment 4 JBoss JIRA Server 2015-08-06 19:10:26 UTC
Tom Cunningham <tcunning> updated the status of jira ENTESB-3632 to Closed