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.
- Download and unpack
osaf-server-bundle-x.y.z
- Create a database (see CosmoDatabaseSetup).
- 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)
- Unzip chandler.war to
$JBOSS_HOME/server/default/deploy/chandler.war
- Remove
$JBOSS_HOME/server/default/deploy/chandler.war/META-INF
- copy cosmo.properties into
$JBOSS_HOME/server/default/deploy/chandler.war/WEB-INF/classes and edit for your config
- 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
- 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>
- configure
$JBOSS_HOME/server/default/deploy/mail-service.xml to match your mail server
- 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>
- start JBoss
--
RandyLetness - 30 Jun 2008