This article covers a Bloomreach Experience Manager version 12. There's an updated version available that covers our most recent release.

Run 2 Local Bloomreach Experience Manager Instances Simultaneously

Introduction

Goal

Run two Cargo-based Bloomreach Experience Manager instances simultaneously in a development environment.

Background

If you install and run a default archetype that created a Bloomreach Experience Manager project, containing a site, CMS and repository, then by default the following ports are in use:

  • 8080: The Tomcat http connector port on which Tomcat listens for incoming connections to the site and the cms.

  • 8205: The TCP/IP port number on which Tomcat waits for a shutdown command.

  • 8009: The Tomcat https connector port on which Tomcat listens for incoming secure connections to the site and the cms.

  • 8000: The debug port. 

If you have enabled RMI then by default port 1099 is also in use.

If you want to run two Cargo Tomcat instances at the same time, you must specify alternative port numbers in one of the instances.

Configuration

In the second Bloomreach Experience Manager project, specify alternative port numbers by editing the Cargo profile in the root  pom.xml:

<plugin>
   <groupId>org.codehaus.cargo</groupId>
   <artifactId>cargo-maven2-plugin</artifactId>
   <configuration>
     <configuration>
       <properties>
         <cargo.servlet.port>9080</cargo.servlet.port>
         <cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
         <cargo.rmi.port>9205</cargo.rmi.port>
         <cargo.jvmargs>
           <![CDATA[-agentlib:jdwp=transport=dt_socket,address=9000,server=y,suspend=n -noverify ${javaagent}]]>
         </cargo.jvmargs>
       </properties>
     etc.

Make sure that the <properties> tag is the only one at that level, some poms may already have a properties tag there!

Start the second instance with:

mvn -P cargo.run
Use a different hostname for each Tomcat instance, for example:
- Tomcat 1:  http://localhost:8080/cms
- Tomcat 2: http://127.0.0.1:9080/cms
Otherwise, the HTTP session will be shared and user sessions will conflict.

Although you will not immediately run into problems if you don't change the location on which the repository is bound for remote RMI connections some use cases require you to specify a separate location for one of the instances. For instance, if you plan to use the JCR runner. You can do this by changing the repository-address context parameter in web descriptor of the CMS or alternatively conf/context.xml.

For the Channel Manager to work with different ports than the default 8080, you need to also take care of the following:

  1. Enter the CMS Console and configure the port according to what you have defined in your pom.xml file, as discussed above. So you have to configure at /hst:hst/hst:hosts/dev-localhost:

    - hst:cmslocation = http://127.0.0.1:9080/cms
    - hst:defaultport = 9080
  2. Rename the node  /hst:hst/hst:hosts/dev-localhost/localhost to  /hst:hst/hst:hosts/dev-localhost/127.0.0.1.

See View a document in a channel for more information.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?