Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Expose Spring Service as a remote EJB

 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
Mac OS X Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic