Archive Packaging and Assembly Rules When Migrating to Red Hat JBoss Enterprise Application Platform

Updated -

Summary

Red Hat JBoss Enterprise Application Platform 6 uses a modular class loading system for controlling the class paths of deployed applications. This system provides more flexibility and control than the traditional system of hierarchical class loaders. This can simplify packaging of archives and eliminate the need to bundle Java EE 6 and other common classes. This article describes the general rules for assembly of archives or directories that are deployed to JBoss EAP 6.

General Rules for Assembly of Archives

  • Archives may be nested within other archived deployments.
  • Extracted directories may be nested in extracted deployments.
  • Archives may be nested in extracted deployments.
  • Extracted directories however may not be nested in archived deployments. You must recreate archives for artifacts nested in other archives.
  • The JBoss EAP 6 installation includes Java EE 6, JBoss Logging, Hibernate, and other commonly used classes in the server install modules/ directory. You can also create custom dynamic modules to make third-party JARs and other resources available to all applications running on the server. Modules are only loaded when a deployment requests them and these JARs or classes should not be bundled within the application archives.
  • For Web applications, it is generally better to avoid the use of a web.xml file if possible. If this file is required, it should be located under the root of the application WEB-INF/ directory.
  • If your enterprise application requires an application.xml file, it should be located under the META-INF/ directory in the root of the EAR.
  • In WebLogic, an extracted WAR, EAR, or other archive can be deployed without the archive extension in the directory name. In JBoss EAP, the extension must appear on the extracted directory name, for example myEnterpriseApp.ear/ or myWebApp.war/.

Additional Resources

For more information about the packaging of archives, see Application Packaging Changes and Package Resources for the New Modular Class Loading System in the Migration Guide for JBoss EAP. For more information about the modular class loading system used in JBoss EAP 6, see the Class Loading and Modules chapter in the Development Guide for JBoss EAP.

Comments