Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project architecture/organization on Java EE application with EJB 3.0, JPA, Dynamic web projects on JBoss

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.?

like image 960
Fernando Briano Avatar asked Jan 07 '09 12:01

Fernando Briano


1 Answers

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.

like image 174
Chris K Avatar answered Nov 09 '22 13:11

Chris K