Ruby and EJBs

Hello All,

I know this topic has been somewhat addressed in the past but I would
really appreciate further help.

I want to call a function that is available as an EJB. Both ruby and
the EJB are run on my localhost. The EJB takes two parameters, a
hashmap and an XML string. I’m familiar with Ruby on Rails and have
been learning it but this is my first attempt to integrate it with an
enterprise system. I purchased “Enterprise integration with Ruby” by
Maik Schmidt but have been unable to draw a clear explaination of how
this can be done.

If anyone can help me out in any way, I will be sure to fully document
my progress and create a tutorial when I am finished and successful. I
will also thank you :slight_smile:

Thanks in advance,

T.

In order to directly invoke EJB methods from Ruby, you’ll need to use
RMI-over-IIOP, which allows CORBA clients to invoke methods on Java RMI
servers, including EJBs. However, there doesn’t seem to have been much
activity on the Ruby/CORBA front in the last couple of years, as web
services have stolen most of CORBA’s thunder outside of legacy
enterprise applications.

It would probably be more reasonable to write a web services adapter
that re-exported the EJB methods you wanted to make available to your
Ruby code via SOAP or XML-RPC. You may want to start with the Sun
documentation on JAX-RPC, the standard web services implementation for
Java.

-Lennon

What Lennon said.

Faced with the exact situation six months ago we found the fastest thing
was
to rewrite the EJB with a SOAP wrapper (it was not that hard) and then
use
Ruby to talk SOAP.

john

One plan we have for JRuby is to provide a way to access EJBs using a
DRb-type layer. Currently no work is being done on that, but if you were
to
put JRuby on the server and handle piping EJB requests over DRb, it
would be
pretty slick (and we’d certainly like to see a proof-of-concept :slight_smile: ).

Hey,

Charles>>
I like the sound of the challenge. Where can I read up about this DRb
layer you speak of?

Basically, I need a shove because I’m stuck on the theoretical aspect
of this. I’ve never done enterprise integration with Ruby. My current
job mainly consists of writing technical training materials, so
anything I am able to develop will definately be written out and I’ll
be sure to make anything I learn public.

rcoder & John>>
I’m a little unsure which direction to take. I have the EJB running and
I now have some classes that should communicate with the EJB (is this
what you mean by rewrite the EJB with a SOAP wrapper?). Should I be
making Ruby try to communicate with these classes now? How does SOAP
fit into this picture?

Thanks guys!
tony

Well, drb is “distributed ruby”, a remoting mechanism provided with
standard
Ruby. It would be a good analog to how EJBs are used, and providing a
drb
proxy to EJBs using JRuby would be fun and useful. I’m certainly no drb
expert though, nor do I have time right now to work on such a wondrous
beast.