The guide on clustering pentaho (see here) says:

In order to keep all cluster nodes current with stored Pentaho content and settings, they must share the pentaho-solutions directory.
I have multiple pentaho installations (pentaho1, pentaho2, ...), the folder "pentaho-solution" is stored outside. Within each node, I have a symlink pointing to that pentaho-solutions folder.

The problem: The first node starts fine, the others complain that the Jackrabbit repository is locked (the repository is within a MySQL database, but the search index is still on the filesystem). The Jackrabbit documentation also mentions:
Each cluster node must have its own repository configuration.
Which means (If I understand correctly): I cannot have one repository.xml configuration used by all nodes, but one repository[1-n].xml file for each node (each with its own repository[1-n] subfolder).

My question:
How can I define in the Tomcat configuration (web.xml, context.xml, or property files within WEB-INF/classes), which repository to use?

What I tried:

Adding a new context-param to web.xml with predefined JCR properties (explained for example here)

Code:
   <context-param>
    <param-name>repository-home</param-name>
    <param-value>...</param-value>
  </context-param>
That doesn't work, since the repository location seems to be hardcoded in repository.spring.xml

Code:
  
<bean id="jcrRepository" class="org.springframework.extensions.jcr.jackrabbit.RepositoryFactoryBean">
    <property name="configuration" value="/jackrabbit/repository.xml"/>
    <property name="homeDir" value="/jackrabbit/repository"/>
  </bean>
Adding a custom system property and reference it in the spring configuration

by adding the following line to repository.spring.xml
Code:
<context:property-placeholder local-override="true" ignore-resource-not-found="true"/>
and modify the definition of the jcrRepository-Bean

Code:
  
<bean id="jcrRepository" class="org.springframework.extensions.jcr.jackrabbit.RepositoryFactoryBean">
    <property name="configuration" value="${repository-configuration}"/>
    <property name="homeDir" value=${repository-directory}"/>
  </bean>
This didn't work, since the property names are resolved within pentaho using SystemConfig. Changing the name of the properties just resulted in errors when spring tried to find other properties (e.g. for the datasource).

Adding a custom properties file and reference it in the spring configuration
Another approach was to add my own jackrabbit.properties into WEB-INF/classes with the following two properties
Code:
jcr.repository.configuration=repo.xml
jcr.repository.home=jackrabbit/repo1
and add the following to repository.spring.xml

Code:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="jackrabbit.properties" />
</bean>
This didn't work, since pentaho only searches within pentaho-solutions/system for property files (and this doesn't work, since we share this folder across all nodes).



Define the JCR repository in context.xml

Ok, my last approach was to define the repository in tomcat/conf/Catalina/localhost/pentaho.xml by adding the following resource to the pentaho context

Code:
<Resource name="jcr/repository"
          auth="Container"
          type="javax.jcr.Repository"
          factory="org.apache.jackrabbit.core.jndi.BindableRepositoryFactory"
          configFilePath="repo.xml"
          repHomeDir="repositoryfolder"/>
Didn't work either.

So, what would be the correct approach?