Disambiguating two EJBs in an .ear file
I'd like to confirm that the following general approach is the right one
(before I start digging into GlassFish errors :-)):
I have a SLSB (of class foo.XBean with no explicitly assigned bean name, so
its bean name is defaulted to "XBean"). XBean implements a @Local
interface, X (in case it matters).
It has this in it:
private Y y;
Y in this case is a @Local interface of another SLSB, foo.YBean, of type
@Local Y, packaged in the same .ear file.
Deployment obviously works fine.
Now suppose I add another Y implementor to the ear file: foo.UnwantedYBean.
This is also, let's say, a @Local implementation of Y.
So two @Local Y implementations in the same .ear file and in the case of
XBean no way to distinguish them. Oops.
Obviously and appropriately deployment fails.
So now I want to make it so that my EJB named XBean injects a foo.YBean
proxy into its y field so that deployment will be happy again. Let's say I
can't do this in the annotations.
Is the following deployment descriptor XML (located obviously in XBean's
ejb jar file, in the META-INF directory--no tricks) supposed to do this?
I've tried to simply duplicate the example on page 448 of the EJB 3.1
specification, but using instead of .
<?xml version="1.0" ?>
For some reason, I've always had trouble parsing the EJB specification on