Bug 969011

Summary: SwitchYard bean services are not properly integrated with CDI support in JBDS
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Jiri Pechanec <jpechane>
Component: ToolingAssignee: Rob Cernich <rcernich>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Pechanec <jpechane>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: jsedlace, kconner, soa-p-jira
Target Milestone: ER1   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Jiri Pechanec 2013-05-30 13:18:20 UTC
When CDI support is enabled in JBDS then JBDS emits false warning about incorrect injections in these cases

a) @Inject org.switchyard.Context
   emits - No bean is eligible for injection to the injection point [JSR-299 ยง5.2.1]

b) @Inject @Reference SimpleService
   emits the same message. The problem is that @Reference is a CDI qualifier but of course there is no bean qualified with this qualifier as we annotate services with @Service annotation

Comment 1 JBoss JIRA Server 2013-05-31 17:39:03 UTC
Rob Cernich <rcernich> updated the status of jira SWITCHYARD-1516 to Coding In Progress

Comment 2 JBoss JIRA Server 2013-05-31 21:58:51 UTC
Rob Cernich <rcernich> made a comment on jira SWITCHYARD-1516

a) can be fixed by simply telling cdi to ignore validation.  Should probably do the same for Message.
b) is a bit tricky because there is not necessarily a corresponding @Service (e.g. if the service being referenced is implemented as a Camel route).  Furthermore, it is possible that the service being injected implements a different, but compatible interface (e.g. WSDL vs. Java).  As a bandaid, I can tell cdi to ignore validation of @Reference (and probably @Property too).

Comment 3 JBoss JIRA Server 2013-06-03 13:30:05 UTC
Keith Babo <kbabo> made a comment on jira SWITCHYARD-1516

I'm OK with (a) provided it only applies to our stuff.  Not sure if that's possible.

Yeah, the solution for (b) would have to synthesize a bean just for validation, sort of like we generate a proxy at runtime to satisfy the dependency.

Comment 4 JBoss JIRA Server 2013-06-03 13:39:15 UTC
Rob Cernich <rcernich> made a comment on jira SWITCHYARD-1516

Regarding (a), I don't think it's very likely that somebody would be implementing either Context or Message _and_ would be injecting those _and_ would have the SwitchYard tools installed.  I don't think SwitchYard users should be implementing those interfaces, so we're probably safe telling the CDI tools to ignore validating those injection points.  If we _really_ think we need this, I can see about disabling validation only for SY projects.

Comment 5 JBoss JIRA Server 2013-06-03 14:11:25 UTC
Rob Cernich <rcernich> made a comment on jira SWITCHYARD-1516

Tell CDI tools to ignore validation of injection points annotated with @Reference or @Property or of types org.switchyard.Context or org.switchyard.Message.

Comment 6 JBoss JIRA Server 2013-06-03 14:29:04 UTC
Keith Babo <kbabo> made a comment on jira SWITCHYARD-1516

pushed

Comment 7 Jiri Pechanec 2013-09-17 10:37:15 UTC
Verified in ER2

Comment 11 JBoss JIRA Server 2014-06-16 23:53:55 UTC
Keith Babo <kbabo> updated the status of jira SWITCHYARD-1516 to Closed