aspose file tools*
The moose likes Spring and the fly likes Expose Spring Service as a remote EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Expose Spring Service as a remote EJB" Watch "Expose Spring Service as a remote EJB" New topic
Author

Expose Spring Service as a remote EJB

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

I have 2 applications
* 1st deployed application contains the business code
* 2nd deployed application is a client application that connects to the business code in the 1st application through a remote EJB call

In the 1st deployed application, there is a stateless local EJB bean and the 2nd application connect to this 1st application EJB through a JNDI call using an instance of the remote interface,

I would like to convert the 1st application EJB bean into a Spring service but how can the other application connect to a proxy instance of this converted EJB service?

Any tutorials or information would be great,

Thanks in Advance,

Niall
Ken Rimple
author
Ranch Hand

Joined: Jul 20, 2010
Posts: 63

Check out the Spring Remoting section of the Spring reference manual - I would recommend not using EJB here - you can use any number of lightweight protocols to expose your Spring beans, such as Hessian, Burlap, Spring's HttpInvoker, or RMI.

If this is internal, remoting should be faster than REST but REST is easier and may be fast enough, although that requires mounting a web mvc app in your back teir.

Another angle is to create a facade spring bean, mount the ejb in your 2nd app using the jee:jndi tag as a Spring bean, and make calls to it via this other Spring bean. Expose the new Spring bean with remoting, and gradually move methods into Spring, replacing the EJB with calls to Spring based APis.
Ken


Ken Rimple
ken.rimple@gmail.com
Co-author, Manning Spring Roo in Action
I teach for Chariot Solutions (Spring, Maven, Hibernate, other courses). Schedule here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Expose Spring Service as a remote EJB