Bug 991462 - Ambiguity when there are 2 implementations of one interface
Summary: Ambiguity when there are 2 implementations of one interface
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Fuse Service Works 6
Classification: JBoss
Component: SwitchYard
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Keith Babo
QA Contact: Jiri Sedlacek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-02 13:02 UTC by Andrej Podhradsky
Modified: 2015-08-02 23:44 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-08-22 17:45:52 UTC
Type: Bug
Embargoed:


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

Description Andrej Podhradsky 2013-08-02 13:02:33 UTC
Created attachment 781960 [details]
switchyard-example

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:
Always

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 13:43:41 UTC
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.