application packaging
wlwa4us Jun 20, 2003 6:07 PMTo the expert in J2EE/JBoss,
I am writing a not so simple application that involves the use of Web and EJBs. In this application has some session beans as follow; SessionBeanA, SessionBeanB, and SessionBeanC, and entity beans as follow; EntityBeanA, EntityBeanB and EntityBeanC.
All of the entity beans are declared as local, but some of the session beans are declared as local and some are declared as remote. The session beans are referenced by servlets in the web component. The session beans reference the entity beans.
My questions are following;
I. Can I separate Entiy beans and Session beans to indivitual jar file.
1) Package all entity beans in a module (EntityBeanModule.jar) that contains its own ejb-jar.xml and jboss.xml and all session beans in a module (SessionBeanModule.jar) that contains its own ejb-jar.xml and jboss.xml.
2) The application directory structure looks the following:
Application.ear
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
EntityBeanModule.jar
SessionBeanModule.jar
WebModule.war
lib/
lib/ejb-client.jar //contain remote interfaces for servlets
3) What is the benefit for doing this? It seems to create a lot more of works in the looking up of the entity beans. Would the invocation of the entity bean be local or remote?
II. Can I put all Entity beans and Session beans to one jar file.
1) Package all entity beans and session beans in a jar file (EJBsModule.jar) that contains its own ejb-jar.xml and jboss.xml.
2) The application directory structure looks the following:
Application.ear
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
EJBsModule.jar
WebModule.war
lib/
lib/ejb-client.jar //contain remote interfaces for servlets
3) What is the benefit for doing this? It saves a lot of works compare to the option I. I can see there is a potential problem for maintenance when the number EJB beans increase to more then 100. What happen when the entity beans need to run on a separate application server?
Thank you in advance,
Kam