r2 - 07 Jul 2008 - 11:40:46 - RandyLetnessYou are here: OSAF >  Documentation Web  >  ServerBundleAdministrator > ServerBundleInstallation > CosmoJBoss
Cosmo web server

Deploying Cosmo in JBoss



See CosmoServletContainerRequirements for the general set of expectations the Cosmo webapp has for a servlet container. This document describes how to meet those expectations with JBoss 4.2.2. It assumes familiarity with configuring JBoss and deploying web applications into the server.

Installation instructions

These instructions are for Windows systems, but the modifications for Unix like systems should be obvious. Filesystem paths within the JBoss installation are prefixed with $JBOSS_HOME. Relative filesystem paths refer to the base directory of the unpacked Cosmo webapp tarball.

  1. Download and unpack osaf-server-bundle-x.y.z
  2. Create a database (see CosmoDatabaseSetup).
  3. Copy the following jars from osaf-server-bundle-x.y.z/common/lib to $JBOSS_HOME/server/default/lib
    • mysql-connector-java-5.0.4.jar (or relevent jdbc driver)
  4. Unzip chandler.war to $JBOSS_HOME/server/default/deploy/chandler.war
  5. Remove $JBOSS_HOME/server/default/deploy/chandler.war/META-INF
  6. copy cosmo.properties into $JBOSS_HOME/server/default/deploy/chandler.war/WEB-INF/classes and edit for your config
  7. There are conflicts with the hibernate jars installed with JBoss, so to get around those, replace all hibernate*.jar files in $JBOSS_HOME/server/default/lib with all hibernate*.jar files in $JBOSS_HOME/server/default/deploy/chandler.war/WEB-INF/lib
  8. create mysql-ds.xml in $JBOSS_HOME/server/default/deploy example:

<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: CosmoJBoss.txt,v 1.2 2008/07/07 18:40:46 RandyLetness Exp $ -->
<!--  Datasource config for MySQL using 3.0.9 available from:
http://www.mysql.com/downloads/api-jdbc-stable.html
-->

<datasources>
  <local-tx-datasource>
    <jndi-name>jdbcCosmo</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/cosmo16</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>root</user-name>
    <password></password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <!-- should only be used on drivers after 3.22.1 with "ping" support
    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
    -->
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
      -->
    <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
      -->

    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>

  1. configure $JBOSS_HOME/server/default/deploy/mail-service.xml to match your mail server
  2. create jboss-web.xml in $JBOSS_HOME/server/default/deploy/chandler.war/WEB-INF

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
 <resource-ref>
   <res-ref-name>jdbc/cosmo</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <jndi-name>java:jdbcCosmo</jndi-name>
 </resource-ref>
 <resource-ref>
   <res-ref-name>mail/cosmo</res-ref-name>
   <res-type>javax.mail.Session</res-type>
   <jndi-name>java:/Mail</jndi-name>
 </resource-ref>
</jboss-web>

  1. start JBoss

-- RandyLetness - 30 Jun 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.