Phillipe,

what is the advantage of using EJB References compared to normal JNDI
lookup?

Miro Halas 

-----Original Message-----
From: Philippe Coq [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 20, 2000 4:44 AM
To: Paolo Sommaruga
Cc: [EMAIL PROTECTED]
Subject: Re: jonas-ejb-ref missing


Paolo Sommaruga wrote:
> 
> Hi,
> 
> I am tried to migrate my beans from JOnAS 2.2.2 to JOnAS 2.2.3. GenIC
reports:
> 
> ...
> GenIC ERROR: When reading the Deployment Descriptors for order.xml
> jonas-ejb-ref missing for ejb-ref-name ejb/jpaso/Customer
> ...
> 
> Actually the order.xml uses ejb-ref tag. I suppose JOnAS 2.2.3 requires a
> similar tag in the jonas-order.xml proprietary file.
> What is the correct syntax for jonas-ejb-ref ?
> 
> I have looked at documentation but I haven't find.
> 
> Thanks
> 
>                                 Paolo Sommaruga
Hi Paolo,
we have developped the ejbref features in the current version.
Unfortunately the JOnAS 2.2.3 was not well commited and incomplete,
since the date of the 2.2.3 we have receive a new version
of Jonathan that fix the Jeremie bug found by Miroslav
so we wanted to integrate this new jonathan version 
a JOnAS 2.2.4 version that will be tagged and available today.
I think it will better for you to migrate from JOnAS 2.2.2
to JOnAS 2.2.4 directly.
In this version you will find documentation about EJB reference
Here is what you will find in the JOnAS Bean Programmer's Guide:

EJB references

The EJB references are special entries in the enterprise bean's
environment.
EJB references allow the Bean Provider to refer to the homes of other
enterprise beans using logical names.
For such entries it is recommended to use subcontexts java:comp/env/ejb.

The declaration of the EJB references in the standard deployment
descriptor looks like:

    <ejb-ref>
      <ejb-ref-name>ejb/ses1</ejb-ref-name>
      <ejb-ref-type>session</ejb-ref-type>
      <home>tests.SS1Home</home>
      <remote>tests.SS1</remote>
    </ejb-ref>
    

The JOnAS specific deployment descriptor should map the environment JNDI
name of the EJB reference to
the JNDI name of the associated enterprise bean home. This is done in
the JOnAS specific deployment
descriptor using the jonas-ejb-ref element.

    <jonas-session>
      <ejb-name>SSA</ejb-name>
      <jndi-name>SSAHome</jndi-name>
      <jonas-ejb-ref>
        <ejb-ref-name>ejb/ses1</ejb-ref-name>
        <jndi-name>SS1Home_one</jndi-name>
      </jonas-ejb-ref>
    </jonas-session>
    

The bean locates the home interface of the other enterprise bean using
the EJB reference with this code:
The bean locates the home interface of the other enterprise bean using
the EJB reference with this code:

    InitialContext ictx = new InitialContext();
    Context myenv = ictx.lookup("java:comp/env");
    SS1Home home =
(SS1Home)javax.rmi.PortableRemoteObject.narrow(myEnv.lookup("ejb/ses1"),
SS1Home.class);
  
I hope it helps  

-- 
        Philippe

Philippe Coq  Evidian   Phone: (33) 04 76 29 78 49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to