I have a webapp with different Dynamic Web Projects, each of them generally containing an EJB Project. We want to keep them interacting, as in using beans and classes from each other's EJBs through JNDI, sharing the same database or using their own. But we also want to be able to keep different projects on different servers.
What would be the right focus for this kind of project in terms of architecture and organization?
How should we use EARs? One EAR to rule them all and in the darkness bind them? (sorry, had to do that LOTR reference), or an EAR per server/web project, etc.?
Disk space is cheap, but if you throw everything into a single EAR, your app server is liable to run them all, even if all you want is Service A. You're best breaking commonly used EJBs and deploying them in by themselves, and each individual service's components in their own EARs.
Then, using JBoss as an example, you can simply copy the artifacts right into the deploy directory of whatever server you want to run them on.
OrderManagement.ear InventoryManagement.ear StoreFront.ear
You can then have either all, some or nothing on any particular server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With