Expresso And JBoss-Tomcat Integration

Introduction

Integration of Expresso with JBoss is not overly difficuly, but it does require some steps. Please read the entire article so you can understand the issues involved with the integration, so you will better be able to work with potential issues that may arise during installation.

What you need to complete this installation.

Theory

JBoss has a couple of issues with it that make modifications to the expresso directory structure and configuration files required.

Implementation

Step 1: Purge Console Appenders From the Expresso Configuration System

<?xml version="1.0" encoding="UTF-8"?>
       <       !DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
       <       log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
 <!--The program overrides these inputs and sets ExpressoLog to do the following:
 class="org.apache.log4j.FileAppender
 log location: specified in the default.properties file
 
 You CAN specify the layout here 
 -->
 <appender name="expressoLog" class="org.apache.log4j.RollingFileAppender">
 <param name="MaxFileSize" value="2000KB"/>
 <param name="File" value="%LogDir%/expresso.log"/>
 <param name="Append" value="true"/>
 <layout class="org.apache.log4j.PatternLayout">
 <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%l) - %m\n"/>
 </layout>
 </appender>
 <!--
 <appender name="console" class="org.apache.log4j.ConsoleAppender">
 <param name="Target" value="System.Out"/>
 <layout class="org.apache.log4j.PatternLayout">
 <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
 </layout>
 </appender>
 <appender name="dbLog" class="com.jcorporate.expresso.core.logging.DBAppender">
 <layout class="org.apache.log4j.PatternLayout">
 <param name="ConversionPattern" value="[%t] %C{3} (%F:%L) - %m"/>
 </layout>
 </appender>
 -->
 <!-- TODO: This will be the Expresso Session Appender -->
 <appender name="httpSessionLog" class="org.apache.log4j.FileAppender">
 <param name="File" value="%ExpressoLogFile%"/>
 <layout class="org.apache.log4j.PatternLayout">
 <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m\n"/>
 </layout>
 </appender>
 <!--
 The root configuration for all expresso errors. Disable this category
 to remove ALL expresso logging information -->
 <category name="expresso" additivity="false">
 <priority value="warn"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <!--
 The configuration category for all messages coming out of the expresso
 core packages. -->
 <category name="expresso.core" additivity="false">
 <priority value="warn"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <!-- Security Related Log Categories. To keep security as high as possible,
 the priority shouldn't be set to anything lower than info -->
 <category name="expresso.core.security">
 <priority value="info"/>
 </category>
 <category name="expresso.core.security.Administrative">
 <priority value="info"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <!-- Database related log information -->
 <category name="expresso.core.db"/>
 <category name="expresso.core.db.SQL">
 <!-- turn value="debug" will trace each and every SQL statement
 issued to the database -->
 </category>
 <category name="expresso.core.dbobj"/>
 <category name="expresso.core.dbobj.DBObject">
 <priority value="warn"/>
 </category>
 <!-- Cache Information -->
 <category name="expresso.core.cache"/>
 <category name="expresso.core.job"/>
 <category name="expresso.core.jsdkapi"/>
 <!-- EMailSender/EMailAuthenticator Information -->
 <category name="expresso.core.misc.EMailSender">
 <priority value="info"/>
 </category>
 <!-- Servlet Debugging -->
 <category name="expresso.core.servlet.ControllerServlet"/>
 <category name="expresso.core.servlet"/>
 <!-- The configuration category for all messages coming out of the expresso
 core packages. -->
 <category name="expresso.ervices" additivity="false">
 <appender-ref ref="expressoLog"/>
 </category>
 <category name="expresso.services.validation" additivity="false">
 <priority value="warn"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <category name="expresso.services.job.ValidationJob" additivity="false">
 <priority value="warn"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <category name="expresso.services.controller.Validate" additivity="false">
 <priority value="warn"/>
 <appender-ref ref="expressoLog"/>
 </category>
 <category name="expresso.services.dbTool"/>
 <!-- The channel to log to for everybody's custom Expresso-based
 service -->
 < /log4j:configuration>
    


Step 2: Set up deployment

With JBoss not running, expand the expresso war file into a sub directory of JBoss' deploy directory. On most distributions, the base directory will be $JBOSS_HOME/server/default/deploy. Name the new directory something like expresso5.war. It is important to name the directory with a .war extension. Depending on the name you give it, that will be the name you use to reference the Expresso pages. For example, if you name the directory: testing.war, then to reach the Expresso pages, you would type:

http://localhost:8080/testing/

Now start the JBoss server. If you have deployed Expresso to a directory named expresso5.war, then by typing

http://localhost:8080/expresso5/

You should get the Expresso home page (after JBoss has compiled the jsp pages).