Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Continuum 1.1-SNAPSHOT on JBoss 4.0

These instructions explain how to deploy the (unreleased) Continuum 1.1-SNAPSHOT web application in an existing installation of JBoss 4.0.x.  These instructions were developed using JBoss 4.0.5.GA.

These instructions are written using the JBoss configuration default.  If using a different configuration, modify accordingly. 

1. Copy the derby jar derby-10.1.3.1.jar into $JBOSS_HOME/server/default/lib.

This jar can be found in continuum-webapp/target/continuum-webapp-1.1-SNAPSHOT/WEB-INF/lib if you have built continuum from source, otherwise it may be downloaded from http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/derby/derby/derby-10.1.3.1/derby-10.1.3.1.jar

2. Create a jdbc deployment configuration file named derby-continuum-ds.xml in $JBOSS_HOME/server/default/deploy with the following contents:

No Format
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
     <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
     <!-- Datasources are not available outside the virtual machine -->
     <jndi-name>continuum</jndi-name>
     <!-- for in-process persistent db, saved when jboss stops. The
     org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
     <connection-url>jdbc:derby:database/continuum;create=true</connection-url>
     <!-- The driver class -->
     <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
     <!-- The login and password -->
     <user-name>sa</user-name>
     <password></password>
     <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
     <min-pool-size>5</min-pool-size>
     <!-- The maximum connections in a pool/sub-pool -->
     <max-pool-size>20</max-pool-size>
     <!-- The time before an unused connection is destroyed -->
     <idle-timeout-minutes>5</idle-timeout-minutes>
     <!-- Whether to check all statements are closed when the connection is returned to the pool,
          this is a debugging feature that should be turned off in production -->
     <track-statements/>
  </local-tx-datasource>
</datasources>

3.  Create a jdbc deployment configuration file named derby-users-ds.xml in $JBOSS_HOME/server/default/deploy with the following contents:

No Format
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
     <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
     <!-- Datasources are not available outside the virtual machine -->
     <jndi-name>users</jndi-name>
     <!-- for in-process persistent db, saved when jboss stops. The
     org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
     <connection-url>jdbc:derby:database/users;create=true</connection-url>
     <!-- The driver class -->
     <driver-class>org.apache.derby.jdbc.EmbeddedDriver</driver-class>
     <!-- The login and password -->
     <user-name>sa</user-name>
     <password></password>
     <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
     <min-pool-size>5</min-pool-size>
     <!-- The maximum connections in a pool/sub-pool -->
     <max-pool-size>20</max-pool-size>
     <!-- The time before an unused connection is destroyed -->
     <idle-timeout-minutes>5</idle-timeout-minutes>
     <!-- Whether to check all statements are closed when the connection is returned to the pool,
          this is a debugging feature that should be turned off in production -->
     <track-statements/>
  </local-tx-datasource>
</datasources>

4. Check out Continuum sources from http://maven.apache.org/continuum/source-repository.html

5.  Apply the jboss patch found in http://jira.codehaus.org/browse/CONTINUUM-1167. (applied in Continuum 1.1-beta-3)

6.  Build Continuum as described in  http://maven.apache.org/continuum/guides/development/guide-build-continuum.html

7. Copy the continuum-webapp-1.1-SNAPSHOT.war file found in continuum-webapp/target directory to $JBOSS_HOME/server/default/deploy/continuum.war.

If you built Continuum from source, it will be in continuum-webapp/target.  Note the name change since JBoss uses the name of the war file as the context root.

Some other hints...

 1.  If you are getting the error...ERROR: invalid console appender config detected, console stream is looping

try adding the following parameter to your JBoss startup... -Dorg.jboss.logging.Log4jService.catchSystemOut=false
2.  If you are getting the error...java.lang.NoSuchMethodError:
org.apache.commons.collections.IteratorUtils.emptyIterator()Lorg/apache/commons/collections/ResettableIterator;

try copying commons-collections-3.0.jar into $JBOSS_HOME/server/default/lib.  JBoss 4.0.5 contains a commons-collections.jar in that directory which (according to the manifest) is version 3.1.  JBoss 4.0.1 seems to contain a version of commons-collections.jar which is before 3.0.  There is no information yet as to which version of JBoss upgraded the version of commons-collections.

Continuum 1.3.6 On JBoss-AS 5.1 (and Java 6)

  1. Create JDBC datasource deployment configuration files and deploy as for JBoss 4.0 described above.
  2. Download the 1.3.6 war file
  3. Expand it in the JBoss deploy directory. There's no need to rename it
  4. Update the jboss-web.xml file in the WEB-INF directory with the following content:
    No Format
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss-web PUBLIC
        "-//JBoss//DTD Web Application 5.0//EN"
        "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
    <jboss-web>
    
        <class-loading java2ClassLoadingCompliance='false'>
            <loader-repository>
                org.apache.continuum:loader=continuum
                <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
            </loader-repository>
    
        </class-loading>
    
        <context-root>continuum</context-root>
    
        <resource-ref>
            <res-ref-name>jdbc/continuum</res-ref-name>
            <jndi-name>java:/continuum</jndi-name>
        </resource-ref>
    
        <resource-ref>
            <res-ref-name>jdbc/users</res-ref-name>
            <jndi-name>java:/users</jndi-name>
        </resource-ref>
    
        <resource-ref>
            <res-ref-name>mail/Session</res-ref-name>
            <jndi-name>java:/Mail</jndi-name>
        </resource-ref>
    
    </jboss-web>
    
    Note that the resource-refs still match those in the distribution.
  5. Remove the following jars from the WEB-INF/lib directory:

    activation-1.1.jar

    provided by all JEE 1.4+ containers (and also Java SE 6)

    geronimo-spec-jta-1.0.1B-rc2.jar

    provided by all JEE 1.2+ containers

    jsr-250-api-1.0.jar

    provided by all JEE 5+ containers

    jstl-1.1.2.jar

    provided by all JEE 1.4+ containers

    jtidy-4aug2000r7-dev.jar

    see WAGON-288

    spring-*.jar

    see below

    standard-1.1.2.jar

    provided by all JEE 1.4+ containers

    stax-1.2.0.jar

    provided by all JEE 5+ containers

    stax-api-1.0.1.jar

    provided by all JEE 5+ containers

  6. Download the Spring Framework 3.0.1.RELEASE distribution. The Spring upgrade is necessary because the annotation scanner used in Spring 2.5.x is broken by JBoss 5.x's new VFS file system. See https://jira.springsource.org/browse/SPR-6146.
  7. Install the following Spring 3.0 jars:
    • org.springframework.asm-3.0.1.RELEASE.jar
    • org.springframework.beans-3.0.1.RELEASE.jar
    • org.springframework.context-3.0.1.RELEASE.jar
    • org.springframework.context.support-3.0.1.RELEASE.jar
    • org.springframework.core-3.0.1.RELEASE.jar
    • org.springframework.expression-3.0.1.RELEASE.jar
    • org.springframework.web-3.0.1.RELEASE.jar
  8. Replace jtidy-4aug2000r7-dev.jar with jtidy-r918.jar.
  9. I also modified the WEB-INF/classes/log4j.xml, changing "${appserver.base}/logs" to "${jboss.server.log.dir}". This puts all the continuum logs in the jboss server logs directory.
    slf4j has a bit of a whinge when starting up, but logging seems to work OK.
    Note

    Similar changes can also be made to the continuum-build-agent if you need to deploy that too.

    Warning

    If you deploy a build agent in the same JBoss container as the main continuum server, you will likely encounter CONTINUUM-2496. The workaround is:

    • Move the apache-continuum-1.3.6.war directory out of the JBoss "deploy" directory
    • Start JBoss and wait for this to complete
    • Move the apache-continuum-1.3.6.war back into the JBoss "deploy" directory, thus "hot" deploying it

Thanks To...


The following web site: