How to run multiple instances by copying standalone directory in JPP 6 ?

Solution Verified - Updated -

Environment

  • Red Hat JBoss Portal (JPP)
    • 6.1.0

Issue

  • How to run multiple JPP instances by creating a copy of standalone directory ?
  • When trying to copy standalone directory and set -Djboss.server.base.dir and using different port sets, it seems to work, but when the standalone directory is removed or renamed, the newly created server instances do not start. It seems there are still some references to standalone directory by some gatein modules. Below is the error received.
Message: Failed to add resource root '../../../../../../../../../standalone/configuration/gatein/wsrp/cxf/ws-security/consumer' at path '../../../../../../../../../standalone/configuration/gatein/wsrp/cxf/ws-security/consumer'
    at org.jboss.modules.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:756) [jboss-modules.jar:1.2.2.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:712) [jboss-modules.jar:1.2.2.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:538) [jboss-modules.jar:1.2.2.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:369) [jboss-modules.jar:1.2.2.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:287) [jboss-modules.jar:1.2.2.Final-redhat-1]
    ... 22 more

2014-03-04 14:56:57,225 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
2014-03-04 14:56:57,250 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015950: JBoss Portal Platform 6.1.0 (AS 7.2.1.Final-redhat-10) stopped in 19ms

Resolution

Reason for the error is that the module.xml present in /jboss-jpp-6.1/modules/system/layers/gatein/org/gatein/wsrp/integration/main references the WSRP consumer and producer path as below:

   <resource-root path="../../../../../../../../../standalone/configuration/gatein/wsrp/cxf/ws-security/consumer"/>
   <resource-root path="../../../../../../../../../standalone/configuration/gatein/wsrp/cxf/ws-security/producer"/>

One can bypass this error by simply changing the path and pointing to the copy of standalone (node1 or node2) created.
For example, edit the above mentioned module.xml and change the <resource-root path/> to below -

<resource-root path="../../../../../../../../../node1/configuration/gatein/wsrp/cxf/ws-security/consumer"/>
<resource-root path="../../../../../../../../../node1/configuration/gatein/wsrp/cxf/ws-security/producer"/>

However, since the modules.xml file is common to all the server instances that will be created, changing the above reference to any one node will bring dependencies between servers. Hence, it is advisable to keep the /standalone directory and not delete or rename it.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments