I have tried your work-around, P. Pontbriand, but without luck. My code is
this:

....

String homeName = "CustomerHome";
Context context = new InitialContext();
String interfaceName = "java:comp/env/ejb/" + homeName;
LogManager.log("Looking up " + interfaceName);
Object object;
try {
        object = context.lookup(interfaceName);
}
catch(NameNotFoundException e) {
        //Handle Orion bug
        String orionInterfaceName = homeName;
        LogManager.log("Because of Orion bug: Looking up " + orionInterfaceName);
        object = context.lookup(orionInterfaceName);
}
ejbHome = (EJBHome) PortableRemoteObject.narrow(object, EJBHome.class);

....


At this point I get a second NameNotFoundException.


Is this what you do (with success) aswell?


Randahl









-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Randahl Fink
Isaksen
Sent: 18. januar 2001 20:44
To: Orion-Interest
Subject: RE: Getting the home interface of another EJB from within an
EJB


Thanks a lot for your post - I was getting a little worried that I was the
only person _unable_ to make this work on Orion....

R.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter
Pontbriand
Sent: 18. januar 2001 16:26
To: Orion-Interest
Subject: Re: Getting the home interface of another EJB from within an
EJB


> but how do I get hold of the home interface of _another_ bean?

We've found that Orion exhibits an 'idiosyncracy' in this regard. It can't
seem to decide where to make the home interfaces available in the JNDI ENC.

As I understand it, using the following example EJB-REF in an EJB's
deployment descriptor should make a home interface available through the
described EJB's JNDI ENC:

            <ejb-ref>
                <ejb-ref-name>ejb/OrganizationEJB</ejb-ref-name>
                <ejb-ref-type>Entity</ejb-ref-type>

<home>com.canlink.components.model.party.OrganizationHome</home>

<remote>com.canlink.components.model.party.Organization</remote>
            </ejb-ref>

However, Orion (version 1.4.4 at least) seems to be uable to decide _where_
in the ENC to make this reference available. Again, as I understand it, the
reference should be found using lookup("java:comp/env/ejb/OrganizationEJB").
Unfortunately, we've found that in many cases the reference can only be
found using lookup("OrganizationEJB"). Being in the all-too-typical
situation of frantically trying to satisfy ridiculous deadline/resource
combinations, we haven't spent the time to try and discern a pattern to this
'idiosyncracy', intead prefering to implement a workaround wherein we try
_both_ lookups thusly:

try {
    ref = jndiContext.lookup("java:comp/env/ejb/OrganizationEJB");
}catch(NamingException ne){
    System.err.println("Failed to find Organization; attempting again using
non-standard mapping");
    ref = jndiContext.lookup("OrganizationEJB");
}

If anyone knows (and cares to point out) that the 'idionsyncracy' is in our
understanding (or lack thereof) and not in Orion, please feel entirely free
to speak out.

P. Pontbriand
Canlink Interactive Technologies Inc.







Reply via email to