I recently wanted to get rid off several Standalone distributions of web applications hosted on my server at home. Each web application is using its own Tomcat Servlet container and is consuming memory and cpu due to the fact that each container is running in its own JVM.
Jira was already running on my JBoss 4.0.4GA instance and I wanted to deploy Confluence 2.5.1 in the same instance. It turns out to be not that easy, because there are a few problems with the classloading mechanism JBoss is using.
But after a few minutes I found the solution on Confluence great documentation site. The comments from Lindsay Smith and Gerald MacKenzie in this article gave me the hints about what to do to run both software products in a single JBoss instance.
Here we go (For a complete list of tasks for upgrading or installing Confluence take a look at Atlassians Homepage. The following steps describe only the procedure to build a Confluence WAR archive that is deployable in a JBoss container next to an existing JIRA WAR archive!):
- Unpack the new confluence WAR version in a directory called $NEW_CONFLUENCE_INSTALL_DIR
- Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/classes/log4j.properties
- Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/commons-logging.jar
- Delete file: $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/lib/log4j.jar
- Create the file $NEW_CONFLUENCE_INSTALL_DIR/confluence/WEB-INF/jboss-web.xml with the following content
<?xml version='1.0' encoding='UTF-8' ?><!DOCTYPE jboss-web PUBLIC-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd"> <jboss-web> <class-loading java2ClassLoadingCompliance="false"> <loader-repository> com.example:loader=unique-archive-name <loader-repository-config> java2ParentDelegation=false </loader-repository-config> </loader-repository> </class-loading> <context-root>/confluence</context-root> </jboss-web>
- Build the Confluence WAR archive using the build script.