The entire EJB 3.0 web application is packaged in an Enterprise ARchive file. It is just a JAR file with the .ear
file name extension. The .ear
file for this TrailBlazer application contains a beans.jar
file for EJBs, and a web.war
file for servlets and JSP pages. The packaging of the entity beans in the beans.jar
file is explained in more detail later in this trailblazer. The EAR file also contains two configuration files in the META-INF
directory: the application.xml
file and the jboss-app.xml
file.
The application.xml
file for the EJB 3.0 TrailBlazer application is listed as follows. It simply lists the nested JAR files contained in this .ear
file.
<application ... ... >
<display-name>EJB3Trail</display-name>
<description>J2EE Made Easy Trail Map</description>
<module>
<ejb>beans.jar</ejb>
</module>
<module>
<web>
<web-uri>web.war</web-uri>
<context-root>EJB3Trail</context-root>
</web>
</module>
</application>
The jboss-app.xml
file defines a class loader for this application. It makes it simpler for EJB 3.0 to find the default EntityManager
(see here). The content of the jboss-app.xml
file is as follows.
<jboss-app>
<loader-repository>
trailblazer:app=ejb3
</loader-repository>
</jboss-app>