• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two ejb-jar.xml files in ear

 
djyoti sahu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
All,
It may be silly question. Please let me know if I can use two ejb-jar.xml files in ear.

Regards
djyoti
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Section 23.2 of the EJB 2.0 specification states

The ejb-jar file must contain the deployment descriptor in the format defined in Chapter 22. The deployment descriptor must be stored with the name META-INF/ejb-jar.xml in the ejb-jar file.


Since there cannot be two directories or files with the same name, there MUST only be one ejb-jar.xml file in any EAR deployment unit However, you may freely merge two ejb-jar.xml files into one single file if you ever feel the need to...
[ January 27, 2005: Message edited by: Valentin Crettaz ]
 
Mark Lybarger
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
since each and ejb-jar is a collection of beans which contains an ejb-jar.xml to describe the beans, and an ear is potentially a collection of 0-n ejb-jar's and 0-n war's, then yes, an ear may contain mulitple ejb-jar.xml files.

you can put all your message beans in one ejb-jar, with it's own ejb-jar.xml, all your entity beans/session facade beans into another ejb-jar with it's own ejb-jar.xml, then you'll have multiple ejb-jar.xml files into one ear.

a single ejb-jar file though (a jar file that contains enterprise java beans) can only contain one ejb-jar.xml. though it does not need to contain a META-INF/MANIFEST.MF file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic