EAR file
An Enterprise Archive File (EAR) is a convenient way to bundle up all the pieces of a full-fledged J2EE application. An EAR keeps everything organized.
An EAR can contain at least one of any of the following modules. You can safely omit any of them, if they aren't needed.
An example application.xml file:
Hat Tip: Oreilly's book: JBoss at Work - A Practical Guide by Tom Marrs & Scott Davis
Technorati Tags: EAR file, EAR
Blogs linking to this article
An EAR can contain at least one of any of the following modules. You can safely omit any of them, if they aren't needed.
- Web module - A WAR file containing presentation tier components
- EJB module - An EJB JAR file containing the middle-tier components (EJBs)
- Java module - A regular JAR file containing classes and libraries that are shared across the entire application. An application client JAR and a common JAR are two examples
of Java modules
An example application.xml file:
<?xml version="1.0" encoding="UTF-8"?>The elements in application.xml should be pretty self-explanatory. We are telling the application server the name of each JAR and what function it serves. Notice that Web modules allow you to specify one other value - the <context-root>. The context root is your web site's URL. If you deploy a simple WAR file, the name of the WAR will be used as the URL. When your WAR file is deployed inside an EAR, this element allows you to override the physical name of the WAR and use whatever URL you'd like.
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd"
version="1.4">
<display-name>JBossAtWorkEAR</display-name>
<module>
<web>
<web-uri>webapp.war</web-uri>
<context-root>jaw</context-root>
</web>
</module>
<module>
<java>common.jar</java>
</module>
</application>
Hat Tip: Oreilly's book: JBoss at Work - A Practical Guide by Tom Marrs & Scott Davis
Technorati Tags: EAR file, EAR
Blogs linking to this article
0 Comments:
Post a Comment
<< Home