Show Table of Contents
2.8. Using Modeshape as the JCR
ModeShape is a Java Content Repository (JCR) that can be used in place of Apache Jackrabbit and has been included as a technical preview in JBoss Enterprise BRMS 5.2 and 5.3.
The following requirements must be met before ModeShape can be installed:
- The BRMS standalone package has been downloaded and installed, refer to the JBoss Enterprise BRMS Getting Started Guide for further instructions.
- Apache Ant is installed. Refer to the appendix at the back of this guide for directions.
- A supported database server is required for production deployment. Refer to https://access.redhat.com/knowledge/articles/119933 for a complete list of supported database servers.
- The database instance that will be used has already been created.
- A database user with permissions to change the database exists.
- The JDBC driver JAR file for the database is in the
lib/directory of the server configuration.
Procedure 2.6. Configure ModeShape
- Run the ant installer from the ModeShape directory and specify the server profile ModeShape will be installed to.
[localhost modeshape]$ ant Buildfile: /opt/BRMS/5.3.1/brms-standalone-5.3.1/modeshape/build.xml determine_home: set-web-home: set-as-home: set-soa-home: init: [echo] JBoss Home is ../jboss-as-web prompt: [input] Enter profile to install ModeShape to: [default] - Add the user accounts
adminandmailman, and assign the roles specified below. The default configuration uses text files to store the usernames, passwords, and assigned roles. The directions here assume that the authorization configuration has not been changed. If it has been changed, then add the users according to that configuration.- Open the file
PROFILE/conf/props/brms-users.propertiesin a text editor and add the usersadminandmailmanto this file as a new line with the syntax:username=password.admin=s3kr3t5 mailman=53cur3m@1l
- Assign the roles specified below to the two users by opening the
PROFILE/conf/props/brms-roles.propertiesfile in a text editor and adding a new line for each user with the syntaxusername=role1, role2, role3.Theadminuser must be assigned the roles ofJBossAdmin,HttpInvoker,user, andadmin.Themailmanuser must be assigned the roles ofJBossAdmin,readwrite.admin=JBossAdmin, HttpInvoker, user, admin mailman=JBossAdmin, readwrite
- Optionally, the passwords can be stored in encoded form instead of plain text. To do this run the following command in the application server directory (
jboss-asorjboss-as-web) to create the encoded form of the password, replacing PASSWORD with the chosen password.[localhost]$ java -cp client/jboss-logging-spi.jar:lib/jbosssx.jar org.jboss.resource.security.SecureIdentityLoginModule PASSWORD Encoded password: 5f78dc15b9a559cbdf8592078de921bc
Then replace the passwords stored inPROFILE/conf/props/brms-users.propertieswith the encoded versions.
- The default configuration for Modeshape uses a database that is not suitable or supported in production environments. Before deploying into a production environment, this configuration must be changed to a supported database server.The default Modeshape repository configuration uses a JNDI data source —
ModeShapeBRMSRepo— for data storage which is configured in thePROFILE/deploy/modeshape-brms-store-ds.xmlfile. Edit this file to change the data source configuration from Hypersonic to the database of your choice. This file is a standard JBoss data source configuration file.Refer to the Datasource Configuration chapter of the Application server documentation for details to configure JBoss data sources. - Edit the
jboss-brms.war/WEB-INF/components.xmlfile to remove the Apache Jackrabbit configuration and add the ModeShape configuration.To remove the Apache Jackrabbit configuration, comment out the following section:<property name="properties"> <key>org.drools.repository.configurator</key> <value>org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator</value> <!-- the root directory for the repo storage the directory must exist. --> <!-- <key>repository.root.directory</key><value>/opt/yourpath</value> --> </property>
The ModeShape configuration is commented out in the default configuration. Uncomment the configuration as shown below:<property name="properties"> <key>org.drools.repository.configurator</key> <value>org.drools.repository.modeshape.ModeShapeRepositoryConfigurator</value> <key>org.modeshape.jcr.URL</key><value>jndi:jcr/local?repositoryName=jcrrepo</value> <key>org.drools.repository.secure.passwords</key><value>false</value> <key>org.drools.repository.admin.password</key><value>admin</value> <key>org.drools.repository.mailman.password</key><value>mailman</value> </property>
- ModeShape requires two user accounts to exist,
adminandmailman. The passwords for these accounts must be specified in the ModeShape configuration from the previous step.<key>org.drools.repository.secure.passwords</key><value>false</value> <key>org.drools.repository.admin.password</key><value>password</value> <key>org.drools.repository.mailman.password</key><value>password</value>
- Restart the server.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.