Configuring Hippo 7 for MSSQL and Tomcat
By default Hippo 7 application is configured to work with Jetty and Derby database. Although there is article regarding MySQL ( http://wiki.onehippo.com/display/CMS7/Configuring+Hippo+7+for+MySQL ) there is no details regarding configuration for Tomcat and MSSQL for example. Goal of the article is to drop some light on this topic. Basically there are just few things that you have to add/change. So, let see where is the secret.
There are two files which have to be created:
- repository.xml
- context.xml
By default, these two will not be generated so you have to do this manually.
File repository.xml is part of Jackrabbit configuration and it contains data regarding PersistaneceManager, SaerchIndex related to Lucene indexing, etc. If you need more info regarding Jackrabbit go to official site.
Follow these two steps:
First step is to actually create repository.xml file and add it in your project.
- Create the path classes/org/hippoecm/repository inside your project's cms/src/main/webapp/WEB-INF directory. Create a file called repository.xml. In case of MSSQL this file should look like this repository.xml.
Second and final step is to prepare context.xml file.
- Create context.xml file in cms/src/main/webapp/META-INF folder. This file contains JNDI resource definition regarding datasource. It should look like this:
<?xml version="1.0" encoding="utf-8"?> <Context> <Resource name="jdbc/repositoryDS" auth="Container" type="javax.sql.DataSource" username="myusername" password="mypassword" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:1433;databaseName=mydb" maxActive="100" maxIdle="30" maxWait="10000" /> </Context>
In addition to this, to achieve the final goal having application communicate with MSSQL, following jars should be copied into $CATALINA_HOME/lib folder.
- geronimo-jta_1.1_spec-1.1.jar - JTA implementation
- sqljdbc4.jar - MSSQL JDBC driver
- commons-pool-1.5.1.jar
Be aware that Hippo 7.0 version is using Jackrabbit 1.4, therefore repository.xml should properly define.
Important:
The DbDataStore (check repository.xml) uses for the database name "sqlserver" instead of "mssql" like the other stores. Therefore repository.xml for JackRabbit 1.4 should use databaseType="sqlserver".This issue has been resolved in jackrabbit 1.5 .
From version 7.1, Hippo delivers new Jackrabbit 1.5, therefore repository.xml given above should be adjusted.
NOTE: This configuration is tested for Hippo7.0, Tomcat 6.0.18 and MSSQL server 2000.