Ideally you should not be providing any properties to the InitialContext to
avoid portabliltiy issues. The URL should be specified at the time of
deployment when the ejb-ref is linked to the bean by specifying a URL like
"corbaloc:iiop:1.2@<host>:<port>/<objectkey>". This will be specified in the
server specific descriptor.This however will work only in case the server
supports Naming Interoperability (EJB 2.0 specification Section 19.7).
In case portability is not an issue or the server does not support this you
can do a cross VM lookup by providing the properties to the InitialContext
where in you specify the URL as well as the ContextFactory class. Also in
this case the lookup string will be the JNDI name of the referenced bean and
not he java contextual lookup( java:comp:/env").
Hope this helps.
Amit,
----- Original Message -----
From: Marco Mistroni <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 20, 2002 5:37 PM
Subject: Re: ejb reference & ejb link
Hi all,
ok i have tried to reference an EJB that was deployed
in another jar on the SAME machine.
it worked fine.
I guess i can do the same also for EJB running on different JVM,
since, in my understanding, the only thing that i have to change
in the Bean that wants to instantiate the referenced bean is to
create a new InitialContext with properties that includes another URL.
I guess that should work. has anyone ever tried?
regards
marco
> -----Original Message-----
> From: ext Amit Khanna [mailto:[EMAIL PROTECTED]]
> Sent: 20. February 2002 13:30
> To: [EMAIL PROTECTED]
> Subject: Re: ejb reference & ejb link
>
>
> It is also possible to reference a bean outside the ear.
> However in that
> case the ejb-link element cannot be used to specify this reference.
>
> Amit.
>
> ----- Original Message -----
> From: Johan Eltes <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 20, 2002 12:56 PM
> Subject: Re: ejb reference & ejb link
>
>
> > J2EE 1.2: No
> > J2EE 1.3: Yes, within the same EAR.
> >
> > /Johan
> >
> > -----Original Message-----
> > From: A mailing list for Enterprise JavaBeans development
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Glenn Dickson
> > Sent: den 20 februari 2002 08:17
> > To: [EMAIL PROTECTED]
> > Subject: Re: ejb reference & ejb link
> >
> > I thought one could not reference another bean outside of it jar?
> >
> > Glenn
> > ----- Original Message -----
> > From: "Katz, Guy" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 19, 2002 10:03 PM
> > Subject: Re: ejb reference & ejb link
> >
> >
> > > just 'link' your resource ref to the other bean's jar file.
> > > <ejb-ref>
> > > ....
> > > .....
> > > <ejb-link>.../../DispatcherBean.jar#DispatcherBean
> > > <ejb-ref>
> > >
> > > -----Original Message-----
> > > From: Marco Mistroni [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, February 19, 2002 3:48 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: ejb reference & ejb link
> > >
> > >
> > > hi all,
> > >
> > > i am trying to use an ejb-ref for referring other
> beans from my own
> > Bean.
> > > the examples that i have seen (in Mastering EJB II) shows
> that the two
> > beans
> > > are declared
> > > in the SAME deployment descriptor.
> > >
> > > But what if the bean to be referenced is in another jar
> file, deployed
> > with
> > > another deployment
> > > descriptor??
> > >
> > > how then shall i structure my deployment descriptor??
> > >
> > > here is the sample of my deployment descriptor of bean
> ConverterBean
> > >
> > > <ejb-jar>
> > > <enterprise-beans>
> > > <session>
> > > <ejb-name>ConverterBean</ejb-name>
> > > <home>converter.ConverterHome</home>
> > > <remote>converter.Converter</remote>
> > > <ejb-class>converter.ConverterBean</ejb-class>
> > > <session-type>Stateless</session-type>
> > > <transaction-type>Container</transaction-type>
> > >
> > > <ejb-local-ref>
> > > <description>First trial of an EJB reference</description>
> > > <ejb-ref-name>ejb/Dispatcher</ejb-ref-name>
> > > <ejb-ref-type>Session</ejb-ref-type>
> > > <local-home>dispatcher.DispatcherHome</local-home>
> > > <local>dispatcher.Dispatcher</local>
> > > <ejb-link>DispatcherBean</ejb-link>
> > > </ejb-local-ref>
> > >
> > > </session>
> > >
> > >
> > > </enterprise-beans>
> > > <assembly-descriptor>
> > > <container-transaction>
> > > <method>
> > > <ejb-name>ConverterBean</ejb-name>
> > > <method-name>*</method-name>
> > > </method>
> > > <trans-attribute>Required</trans-attribute>
> > > </container-transaction>
> > > </assembly-descriptor>
> > > </ejb-jar>
> > >
> > >
> > > when i try to run the weblogic ejb compiler, i got (obviously) the
> > following
> > > exception:
> > >
> > > ERROR: Error from ejbc:
> > > In ejb-jar.xml, the EJB 'ConverterBean' contains
> an invalid
> > > ejb-local-re
> > > f 'ejb/Dispatcher'. The ejb-local-ref must either have an
> ejb-link set
> or
> > an
> > > ejb
> > > -local-reference-description must be added to the
> weblogic-ejb-jar.xml
> > > descripto
> > > r for this ejb-local-ref.
> > > ERROR: ejbc found errors
> > >
> > >
> > > Can anyone help me??
> > >
> > > thanx in advance and regards
> > > marco
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> ==============================================================
> ============To
> > > unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> > > of the message "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". 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 "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".