View RSS Feed


Class Loading Precedence

Rate this Entry
by , 04-27-2012 at 06:32 PM (961 Views)
A common source of errors in Java applications is including API classes in a deployment that are also provided by the container. This can result in multiple versions of the class being created and the deployment failing to deploy properly. To prevent this in AS7, module dependencies are added in a specific order that should prevent this situation from occurring.

In order of highest priority to lowest priority

  1. System Dependencies - These are dependencies that are added to the module automatically by the container, including the Java EE api's.
  2. User Dependencies - These are dependencies that are added through jboss-deployment-structure.xml or through the Dependencies: manifest entry.
  3. Local Resource - Class files packaged up inside the deployment itself, e.g. class files from WEB-INF/classes or WEB-INF/lib of a war.
  4. Inter deployment dependencies - These are dependencies on other deployments in an ear deployment. This can include classes in an ear's lib directory, or classes defined in other ejb jars.

Submit "Class Loading Precedence" to Facebook Submit "Class Loading Precedence" to Digg Submit "Class Loading Precedence" to Submit "Class Loading Precedence" to StumbleUpon Submit "Class Loading Precedence" to Google