Creating deployment structure and infrastructure deployment descriptors

We have not yet discussed two files: webapp/WEB-INF/jboss-deployment-structure.xml and resources/META-INF/spring/infrastructure.xml. The jboss-deployment-structure.xml file is a JBoss-specific deployment descriptor used to configure fine-grained class-loading. If the jboss-deployment-structure.xml file is not included, the default class-loading is used, which might not be what is required for an application. The jboss-deployment-structure.xml file can be used for the following purposes:

  • Preventing the inclusion of automatic dependencies
  • Adding additional dependencies
  • Defining additional modules
  • Adding additional resource roots to a module
  • Modifying an EAR deployments isolated class loading behavior

We have used jboss-deployment-structure.xml to include dependencies on the org.codehaus.jackson.jackson-core-asl, org.codehaus.jackson.jackson-mapper-asl, org.slf4j, and mysql modules.

The jboss-deployment-structure.xml file is listed as follows:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
    <!-- <exclusions>
      <module name="org.hibernate" />
    </exclusions> -->
    <dependencies>
      <module name="mysql" />
      <module name="org.codehaus.jackson.jackson-core-asl" />
      <module name="org.codehaus.jackson.jackson-mapper-asl" />
      <module name="org.slf4j" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

The infrastructure.xml file is used for the following purposes:

  • Registering the entity manager factory in JNDI
  • Registering the data source in JNDI
  • Enabling JTA transaction management

The infrastructure.xml file is listed as follows:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
    <!-- <exclusions>
      <module name="org.hibernate" />
    </exclusions> -->
    <dependencies>
      <module name="mysql" />
      <module name="org.codehaus.jackson.jackson-core-asl" />
      <module name="org.codehaus.jackson.jackson-mapper-asl" />
      <module name="org.slf4j" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

The directory structure of the Spring Maven application's jboss-springmvcsrcmainjava and jboss-springmvcsrcmain esources directories is shown in Project Explorer in the following screenshot:

Creating deployment structure and infrastructure deployment descriptors

The directory structure of the Spring Maven application's jboss-springmvcsrcmainwebapp directory is also shown in Project Explorer in the following screenshot:

Creating deployment structure and infrastructure deployment descriptors
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset