• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to write a deployable services in Spring like EJB jar?

 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are planning to develop a web application following 3-tier architecture.
The web application will be deployed on Tomcat Server and I want to write my Services as POJO Services and wire them up using Spring and will be deployed on a JBoss server probably on some other machine. My DB server(MySQL) will be on some other machine.

Now my question is when we develop our service layer using EJB's we will make a jar file and put it in deploy(jboss) folder and when the JBoss server is started it will automatically scan through the jar and EJBs will be created by the JBoss itself. Now i can get an EJB by doing a JNDI lookup.

Now if i write my service layer using Spring POJO approach, i have my services ready (as a jar file) how can deploy/use these services from some other JVM/webapplication?

Thanks.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'd have to expose them using some sort of remoting technology or web services.
 
Siva Prasad Reddy Katamreddy
Ranch Hand
Posts: 32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

But even though we use Spring Remoting we should deploy the Spring Service jar file either in a .war or in a .ear file and in servlet startup we should instantiate the ApplicationContext. Am I right?

Thanks,
Siva
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, no matter what you have to start up the ApplicationContext in some way. And you would generally want run it as a web app (.war) or JEE app (.ear) because having a web/application server handles a lot of stuff (like deployment, administration, clustering, etc.) that you'd have to find another way to handle if you were making a stand alone app - but (unless the remoting mechanism requires running in a server) you can just make a standalone app that you could run as a service or command-line program.
reply
    Bookmark Topic Watch Topic
  • New Topic