Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-5968

jboss-deployment-structure.xml depend on ear name


    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 7.1.1.Final
    • Server
    • None

      Here's my use case: I've an application ear which contains an ejb module and a war module.

      • myapp.ear
        • myapp-ejb.jar
        • myapp-gwt.war

      The application runs in a cluster of 2 nodes.
      I've some scheduled EJBs and I need different schedules on the two cluster nodes, so I package my application in two different ear files:

      • myapp-node1.ear
      • myapp-node1.ear

      Both files are identical except ear/myapp-ejb.jar/META-INF/ejb.xml in which I've different <timer> configurations.

      ear/META-INF/application.xml is

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" id="Application_ID" version="6">
        <display-name>My Application</display-name>

      Declaring <application> all my EJB have the same JNDI application name even if they come from different ear files.

      The problem is in the ear/META-INF/jboss-deployment-structure.xml
      It is not possible to use subdeployments isolation because I must use the real ear name.

      			<module name="org.apache.commons.lang" />
      	<sub-deployment name="myapp-ejb.jar">
      			<module name="org.apache.commons.lang" />
      			<module name="org.apache.commons.collections" />
      			<module name="org.apache.commons.configuration" />
      			<module name="org.apache.commons.codec" />
      			<module name="org.apache.httpcomponents" />
      	<sub-deployment name="myapp-gwt.war">
      			<module name="deployment.myapp.ear.myapp-ejb.jar" />

      The problem is the line

      <module name="deployment.myapp.ear.myapp-ejb.jar" />

      beacuse it is mandatory to use the actual ear file name.

      In this situation it will be usefull to have an "alias" to indicate the containing ear, so the above line could be

      <module name="deployment.self-ear.myapp-ejb.jar" />

      The workaround for this issues are:

      • use <ear-subdeployments-isolated>false</ear-subdeployments-isolated> and do not declare any dependencies
      • use different jboss-deployment-structure.xml files with real ear file names

            jgreene@redhat.com Jason Greene
            marcoben73 Marco Benuzzi (Inactive)
            0 Vote for this issue
            2 Start watching this issue