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?
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.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Remember to always leap before you look. But always take the time to smell the tiny ads: