|
From: Thomas B. B. <tb...@sy...> - 2001-04-04 11:54:26
|
In addition to the question posted previously, I can now add the following:
I've tried something like this:
...
from vm import SimpleBean
from vm import SimpleBeanHome
from javax.naming import Context
from javax.naming import InitialContext
from javax.rmi import PortableRemoteObject
initCtx = InitialContext()
sbHomeRef = initCtx.lookup('ejb/SimpleBean')
...
from within my Jython script. Until this point, everything works fine. This
is very similar to the "standard" way of looking up an EJB from a J2EE
program. However, when you in Java at this point would write:
sbHome = (SimpleBeanHome)
PortableRemoteObject.narrow(sbHomeRef,
SimpleBeanHome.class);
sb = sbHome.create();
next, in Jython I'm not sure how to go about this? How can I get the remote
interface created?
Cheers,
Thomas
> -----Original Message-----
> From: Thomas Bang Biilmann
> Sent: 3. april 2001 16:50
> To: Jython Dev (E-mail)
> Subject: EJB access from Jython
>
> Hi.
>
> I'm currently experimenting with Jython scripting inside an
> EJB deployed to Borland AppServer 4.5. The EJB (a stateful
> session bean) is up and running, e.g. I can issue a simple
> Jython script from the client and get the script executed on
> the server. Now, I need to get access to other EJBs from the
> bean implementing Jython scripting. I know that in the case
> of beans (not EJBs, but JavaBeans), this is done via
> registerBean/lookupBean or declareBean, but when it comes to
> "looking up" an EJB, I'm lacking knowledge. How can this be done?
>
> /Thomas
|