-
Bug
-
Resolution: Won't Do
-
Minor
-
None
-
7.1.1.Final
-
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"> <application-name>myapp</application-name> <display-name>My Application</display-name> <module> <ejb>myapp-ejb.jar</ejb> </module> <module> <web> <web-uri>myapp-gwt.war</web-uri> <context-root>myapp</context-root> </web> </module> </module> </application>
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.
<jboss-deployment-structure> <ear-subdeployments-isolated>true</ear-subdeployments-isolated> <deployment> <dependencies> <module name="org.apache.commons.lang" /> </dependencies> </deployment> <sub-deployment name="myapp-ejb.jar"> <dependencies> <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" /> </dependencies> </sub-deployment> <sub-deployment name="myapp-gwt.war"> <dependencies> <module name="deployment.myapp.ear.myapp-ejb.jar" /> </dependencies> </sub-deployment> </jboss-deployment-structure>
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