views:

131

answers:

2

I have an ear file which contains 4 war files. The main reason we put those together is, that the order of startup is important, and it is easier from a deployment perspective (the customer only gets one file and does not have to worry about which versions works together).

The ear files are going to be deployed on 4 different systems, which are a bit different, so on two of the servers one of the war apps doesn't even need to be started.

The runtime environment is JBOSS 4.2.2.

Therefore my question is: What are my options to prevent the war file to be started, if I want to configure it via properties defined in properties-service.xml?

Another option, because the applications are actually spring applications, would be to prevent starting the ContextLoaderListener, but here I also haven't any idea how to do this via configuration.

+1  A: 

WAR files, which are embedded in an EAR file are not deployed as web applications unless they are defined as modules in the EAR's application.xml deployment descriptor. If you are using JBoss specific deployment descritors instead of the J2EE standard descriptors, you have to change the configuration there instead.

jarnbjo
+1  A: 

You can add list the war in META-INF/application.xml

<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">

  <module>
    <web>
      <web-uri>war1.war</web-uri>
       <context-root>/war1</context-root> 
    </web>   
  </module>
  <module>
    <web>
      <web-uri>war2.war</web-uri>
      <context-root>/war2</context-root>
    </web>   
  </module>


  <library-directory>lib</library-directory>

</application>

The spring context in the unused war will not get started. You will get one spring applicaton context per war. (unless you use shared context)

surajz