Bug 991462 - Ambiguity when there are 2 implementations of one interface
Ambiguity when there are 2 implementations of one interface
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Keith Babo
Jiri Sedlacek
Depends On:
  Show dependency treegraph
Reported: 2013-08-02 09:02 EDT by Andrej Podhradsky
Modified: 2015-08-02 19:44 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-22 13:45:52 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
switchyard-example (7.74 KB, application/zip)
2013-08-02 09:02 EDT, Andrej Podhradsky
no flags Details

  None (edit)
Description Andrej Podhradsky 2013-08-02 09:02:33 EDT
Created attachment 781960 [details]

Description of problem:
Assume that we have 2 implementations of the same interface, say BeanA and BeanB. In switchyard.xml we add only BeanA, promote it as service with file binding. After creating a file in the specified folder, BeanB is used instead of BeanA.

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

How reproducible:

Steps to Reproduce:
1. You can find a maven project in the attachment (it is also an eclipse project)
2. Deploy the project and create any file in JBOSS_HOME/bin/target/input

Actual results:
In log you will see output "B" (which means InfoBeanB was used)

Expected results:
In log you should see output "A"
Comment 2 Keith Babo 2013-08-02 09:43:41 EDT
This is because we automatically register beans as services and BeanA and BeanB are using the same service name.  If you modify the annotation on InfoBeanB to look like this you should only see BeanA invoked:

@Service(value=Info.class, name="InfoB")
public class InfoBeanB implements Info {

Note You need to log in before you can comment on or make changes to this bug.