Hi again!
I want to look at them as two separate beans, only with the same interfaces.
They are both declared and have different names, the only thing they have in
common is the remote and home interfaces. I really would like to be able to
access them both. But when I do the references only one of them works. An
example of how it can look:
<session>
<description>no description</description>
<display-name>Tester</display-name>
<ejb-name>Tester</ejb-name>
<home>test.TesterHome</home>
<remote>test.Tester</remote>
<ejb-class>test.TesterEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<ejb-ref>
<ejb-ref-name>ejb/test/Test1</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<ejb-link>Test1</ejb-link>
<home>test.TestHome</home>
<remote>test.Test</remote>
</ejb-ref>
<ejb-ref>
<ejb-ref-name>ejb/test/Test2</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<ejb-link>Test2</ejb-link>
<home>test.TestHome</home>
<remote>test.Test</remote>
</ejb-ref>
</session>
<session>
<description>no description</description>
<display-name>Test1</display-name>
<ejb-name>Test1</ejb-name>
<home>test.TestHome</home>
<remote>test.Test</remote>
<ejb-class>test.Test1EJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<env-entry>
<env-entry-name>test1/password</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>PASWD1</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>test1/hosturl</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://www.test.com/demo/t1.jsp</env-entry-value>
</env-entry>
</session>
<session>
<description>no description</description>
<display-name>Test2</display-name>
<ejb-name>Test2</ejb-name>
<home>test.TestHome</home>
<remote>test.Test</remote>
<ejb-class>test.Test2EJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
<env-entry>
<env-entry-name>test2/password</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>PASWD2</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>test2/hosturl</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>http://www.test.com/demo/t2.jsp</env-entry-value>
</env-entry>
</session>
-----Ursprungligt meddelande-----
Fran: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]For Marcus Ahnve
Skickat: den 7 november 2000 18:36
Till: Orion-Interest
Amne: Re: ejb-link
Billy Byberg wrote:
>
> I have a problem trying to use the same home and remote classes with
> different implementations of the EJB class.
>
> In the ejb-jar.xml reference tags you specify home and remote interfaces.
> These does not say which ejb to use. It doesn't help to also specify
> ejb-link that should point out the exact EJB to use. The only way to
change
> between different ejb classes with the same home and remote interfaces is
to
> simply use one at a time.
>
> Anyone know a working example that does what I want or know anything I
might
> do wrong? Maybe someone else that has the same problem? Personally I think
> it's a bug in Orion, but I hope to be proven wrong :)
You're in luck, because this is a EJB feature. ejb-jar.xml is defined by
JavaSoft and is the same everywhere you go in EJB country.
You simply can not do this. When referencing one bean from another you
are essentially being just another client of that bean. And since
clients can not, and should not, know anything about the current
implementation, you are not able to declare which implementation bean to
use.
/Marcus
--
Marcus Ahnve email: [EMAIL PROTECTED]
Lecando AB Office: +46-(0)8-634 94 18
Sweden Mobile: +46-(0)70-462 19 18
www.lecando.com ICQ#: 4564879