0

I know that:

Spring is an implementation while EJB 3.0 is a specification. But they do have some areas of overlap, for example both provide a mechanism to deliver middleware services to Java applications.

Now:
In one application I used EJBs deployed on JBoss on one server from a Spring app deployed on Tomcat on another server.

How would I be able tu use spring beans deployed on a server from another server hosting a presentation layer ?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
GionJh
  • 2,742
  • 2
  • 29
  • 68
  • You can't. There are no "remote spring beans". They're two completely different and unrelated technologies. – Kayaman Feb 12 '16 at 21:29
  • so why is always said that spring was developed as an alternative to EJB ? :) – GionJh Feb 12 '16 at 21:35
  • maybe they implicitely refer to the fact that spring bean can be remotely used wrapped in SOAP or REST services ? – GionJh Feb 12 '16 at 21:36
  • Spring provides alternatives to Java EE technologies. If they were identical to them, how would they really be alternatives? – Kayaman Feb 12 '16 at 21:37
  • You can use remoting with Spring beans: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/remoting.html That doesn't necessarily mean, it's the best way to do. – dunni Feb 12 '16 at 21:40
  • I see...Is it right what I stated above, i.e. that Spring beans functionalities can be remoted exposing the through SOAP or REST ? – GionJh Feb 12 '16 at 21:42
  • Spring is not an implementation of EJB let alone of Java EE. Spring is a competitor of Java EE. Tomcat is not a Java EE server and hence many Tomcat folks install Spring on it instead of just moving to a real Java EE server such as TomEE. See also http://stackoverflow.com/questions/7295096/what-exactly-is-java-ee – BalusC Feb 14 '16 at 14:35
  • @Kayaman why wouldn't using spring remoting with spring beans be "remote spring beans"? – eis Feb 14 '16 at 14:51
  • @GionJh your quote seems to come from [this article](http://www.devx.com/Java/Article/32314), which is ten years old and IMO gets a lot of things wrong. I recommend relying on better/more sources. – eis Feb 14 '16 at 14:53
  • Nonethless, your question is perfectly valid and answerable with Spring Remoting example. – eis Feb 14 '16 at 14:59

0 Answers0