2 Replies Latest reply on Oct 14, 2013 3:33 PM by wdfink

    Distinct modules locations per server instance (JBoss EAP Domain mode)

    ahmadzed

      Hello,

       

      In our environment, it is common practice for us to deploy incremental versions of the same application on different server groups / server instances on the same jboss installation in order to perform testing.  Our application utilizes a custom module, which we place in JBOSS_HOME/modules/com/xxx/yyy/main

       

      This works fine.


      Sometimes, we make changes to this module, or another dependency (such as a jdbc driver), and we want to be able to run two server instances each using their own modules folder locations in order to test them simultaneously.

       

      We have been using system properties to have distinct datasources (I configure a single "generic" xa-datasource, using custom system properties for all the connection information, then assign those system properties to the server instances)

      I have tried a similar approach in assigning environment properties "module.path" and "jboss.modules.dir" as system properties to my server instances.  This does not seem to work, the application still looks for modules in JBOSS_HOME/modules

       

      Any help would be greatly appreciated!

        • 1. Re: Distinct modules locations per server instance (JBoss EAP Domain mode)
          jcordes

          Hi Zed,

           

          Did you try to set the JBOSS_MODULEPATH environment variable that is used for example in domain.sh for passing it via -mp (I was assuming you are on Unix/Linux)?

           

          By executing java -jar jboss-modules.jar -help you will get more information what can be actually passed for setting up module-location.

           

          The reason why still the modules directory is used instead of module.path is that -mp is passed in the standard scripts (although possibly with no additional path information).

           

          Kind regards,

           

          Jochen

          • 2. Re: Distinct modules locations per server instance (JBoss EAP Domain mode)
            wdfink

            The idea of the modules is to be able to run different versions of a specific module.

            You can add the same module in different versions by using the subfolder main 1.0 2.0 and so on the module configuration need to have a slot attribute.

            Within the jboss-structure or MANIFEST you can reference a module with a specific version (slot).

            Also you can have different drivers for datasources to use different versions.