Forum: Ruby Ruby and EJavaBeans with RJB

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Andre F. (Guest)
on 2007-05-09 14:20
Hi,

i'm analyzing the possibility of calling a EJB from ruby code,
in order to fetch sets of information from remote server.

Does anyone have done this before?
I' m having trouble in translating the following piece fof code.

Context ctx = new InitialContext(env);
Object narrowFromObj = ctx.lookup();
userSessionHome = (UserSessionHome) PortableRemoteObject.narrow(
          narrowFromObj, ejbRemoteHomeClass);

to

narrowfromobj = init_context.lookup(remoteHomeJndiName)
portable_remote = Rjb::import('javax.rmi.PortableRemoteObject')
portable_remote.narrow narrowfromobj, ejbRemoteHomeClass

and i get the following error:

" method missing : Fail: unknown name 'narrow' (RuntimeError) "

I would be glad to resolve this issue, i´m trying to integrate a RoR app
with in j2ee environment.

Thanks!

André
This topic is locked and can not be replied to.