Dashboard > blojsom 3.0 > ... > Installation > Tomcat Setup for MSSQL
  blojsom 3.0 Log In   View a printable version of the current page.  
  Tomcat Setup for MSSQL
Added by David Czarnecki, last edited by David Czarnecki on May 04, 2007  (view change)
Labels: 
(None)

Download, Install, and Configure Tomcat

  • Download and follow the installation instructions for Tomcat. Installation notes are available from the Tomcat website.
  • Open %TOMCAT_HOME%/conf/server.xml file and check out the settings for various defined <Connector .../> elements. Set the URIEncoding attribute to UTF-8, which is the character encoding format blojsom uses for encoding links. For example:
    <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080"
       maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
       enableLookups="false" redirectPort="8443" acceptCount="100"
       debug="0" connectionTimeout="20000"
       disableUploadTimeout="true" URIEncoding="UTF-8"/>

blojsom Setup

  • Download the blojsom 3.0 blojsom.war file.
  • Create a web application directory for the blojsom 3.0 WAR file in %TOMCAT_HOME%/webapps.

    % mkdir blojsom

  • Copy the blojsom.war file into the %TOMCAT_HOME%/webapps/blojsom directory.
  • Unpack the blojsom.war file.

    jar xvf blojsom.war

  • Delete the blojsom.war file.

Database Driver Setup

  • After unpacking the JTDS JDBC Driver, copy the jtds-1.2.jar file to %TOMCAT_HOME%/common/lib. You will need to extract the JAR from the jtds-1.2-dist.zip file that you download from Sourceforge.

Configure blojsom's Database Settings

  • Edit %TOMCAT_HOME%/webapps/blojsom/WEB-INF/classes/blojsom-helper-beans-include.xml and change only the values for the username and password for your database to the username and password you created earlier.
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
        <property name="url" value="jdbc:jtds:sqlserver://localhost/blojsom"/>
        <property name="username" value="someuser"/>
        <property name="password" value="somepassword"/>
    </bean>
  • Change the hibernate.dialect property in the definition of the hibernateSessionFactory bean to use the org.hibernate.dialect.SQLServerDialect dialect.
    <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="mappingResources">
                <list>
                    <value>Blog.hbm.xml</value>
                    <value>Entry.hbm.xml</value>
                    <value>Category.hbm.xml</value>
                    <value>Comment.hbm.xml</value>
                    <value>Trackback.hbm.xml</value>
                    <value>Pingback.hbm.xml</value>
                    <value>User.hbm.xml</value>
                </list>
            </property>
            <property name="hibernateProperties">
                <props>
                    <prop key="c3p0.min_size">10</prop>
                    <prop key="c3p0.max_size">50</prop>
                    <prop key="c3p0.timeout">1800</prop>
                    <prop key="c3p0.max_statements">100</prop>
                    <prop key="show_sql">false</prop>
                    <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
                </props>
            </property>
        </bean>
  • Edit %TOMCAT_HOME%/webapps/blojsom/WEB-INF/classes/blojsom.xml. You may need to change the value for the dbScript or detectBlojsomSQL property for your particular database. This will be noted in the database installation instructions.
    <bean id="dbloader" class="org.blojsom.util.database.DatabaseLoader" init-method="init">
        <property name="sessionFactory">
            <ref bean="hibernateSessionFactory"/>
        </property>
        <property name="dbScript" value="/WEB-INF/classes/blojsom-full-initial-data-mssql.sql"/>
        <property name="upgrading" value="false"/>
        <property name="servletConfig">
            <ref bean="servletConfigFactoryBean"/>
        </property>
        <property name="detectBlojsomSQL">
            <value>select 1;</value>
        </property>
    </bean>

Accessing blojsom

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators