Java Reference
In-Depth Information
When creating a new ejb-jar.xml document, start by declaring the ejb-jar root element
as follows:
After declaring the root element, start filling in the document with the configuration that
will override your annotations. Remember that ejb-jar.xml is optional. Using annotations is
the preferred development method. If you do use annotations, any matching configuration
you have in ejb-jar.xml will override the annotation. You may, however, not use annota-
tions and put all of your configuration in ejb-jar.xml, but this isn't recommended. We'll
now briefly summarize the child tags of the <ejb-jar...> root document.
A.1.1. <module-name>
<module-name> is used to define the name of the EJB module when deployed to the
Enterprise server:
It's only applicable to standalone EJB-JARS or EJB-JARS packaged in an EAR. It's ig-
nored if used within a .war file, in which case standard .war file module name rules apply.
Though optional, <module-name> is quite useful, especially when build systems like
Maven are used to construct your artifacts. Maven adds version numbers to the names of ar-
tifacts (action-bazaar-ejb-, and although visually this is beneficial because you
can quickly see what version of artifacts are in your Enterprise application, from the point
of view of deployment, version numbers make JNDI lookup names (if needed) extremely
difficult because all lookup names need to change to include the version number. Using
<module-name> can standardize the name of your module when deployed, no matter
the version number.
Search WWH ::

Custom Search