Purpose

This page describes the prerequisite to the installation of Gazelle applications. All the tools developed in the context of the Gazelle testbed project are developed for JBoss (5.0.1-GA or 7.2.0.final) and use a postgreSQL database.

We recommand to install the Gazelle tools in a Debian-like environment, it’s the environment running on IHE Europe servers so we know that it is correctly working. Moreover, most of the installation and configuration procedures are described for such an environment.

PostgreSQL

We are currenlty using PostgreSQL 9.1 on most of our servers.

Install a JVM

Most of our applications running on JBoss7 are using java 7. Consider installing openJDK.

sudo apt-get install openjdk-7-jre

Install JBoss 7 application server

Get package

from: http://gazelle.ihe.net/jboss7/jboss-as-7.2.0.Final.zip

wget -nv -O /tmp/jboss-as-7.2.0.Final.zip https://gazelle.ihe.net/jboss7/jboss-as-7.2.0.Final.zip

Be sure to use this packaged version, we provide the postgresql driver, and use different versions for modules hibernate and javassist.

Get init script

from: http://gazelle.ihe.net/jboss7/init.d_jboss7

wget -nv -O /tmp/init.d_jboss7 https://gazelle.ihe.net/jboss7/init.d_jboss7

Install jboss in the /usr/local folder

cd /usr/local
sudo mv /tmp/jboss-as-7.2.0.Final.zip .
sudo unzip ./jboss-as-7.2.0.Final.zip
sudo ln -s jboss-as-7.2.0.Final jboss7
sudo chown -R jboss:jboss-admin /usr/local/jboss7
sudo chmod -R 755 /usr/local/jboss-as-7.2.0.Final
sudo chown -R jboss:jboss-admin /var/log/jboss7/
sudo chmod -R g+w /var/log/jboss7/

Install the init script and make it start at system startup

sudo mv /tmp/init.d_jboss7 /etc/init.d/jboss7
sudo chmod +x /etc/init.d/jboss7
sudo update-rc.d jboss7 defaults

Install JBoss 7 application server - Automated script 

wget https://gazelle.ihe.net/jenkins/job/Installer_script/ws/jboss7/setup7.sh
wget https://gazelle.ihe.net/jenkins/job/Installer_script/ws/jboss7/common.sh
wget https://gazelle.ihe.net/jenkins/job/Installer_script/ws/jboss7/jboss7
sudo chmod +x setup7.sh
sudo chmod +x common.sh
sudo chmod +x jboss7
./setup7.sh

Update JBoss 7 postgresql jdbc driver

  1. Stop jboss and go to
    cd /usr/local/jboss7/modules/system/layers/base/org/postgresql/main
    
  2. Download driver
    sudo wget https://gazelle.ihe.net/jboss7/postgresql-42.2.1.jre7.jar
    sudo chown jboss:jboss-admin postgresql-42.2.1.jre7.jar
    sudo chmod 775 postgresql-42.2.1.jre7.jar
    
  3. Edit module.xml and update the version
<module xmlns="urn:jboss:module:1.1" name="org.postgresql">
     <resources>
         <resource-root path="postgresql-42.2.1.jre7.jar"/>
     </resources>
     <dependencies>
         <module name="javax.api"/>
         <module name="javax.transaction.api"/>
     </dependencies>
</module>
  1. Clean up your jboss
    sudo rm -rf /usr/local/jboss7/standalone/tmp/
    sudo rm -rf /usr/local/jboss7/standalone/data/
    
  2. Restart your jboss and deploy your ear

Externalize datasources from tool projects

Some projects may have extracted datasources. In order to deploy those projects, you will need to include some special instructions in your jboss server configuration file :

Edit standalone.xml in /usr/local/YOUR_JBOSS_SERVER/standalone/configuration folder and update datasources :

<datasources>
    ...
    <datasource jndi-name="java:jboss/datasources/YOUR_TOOL_DATASOURCES" pool-name="YOUR_TOOL_DATASOURCES" enabled="true" use-java-context="true">
        <connection-url>jdbc:postgresql://localhost:5432/YOUR_TOOL_DB</connection-url>
        <driver>postgresql</driver>
        <security>
            <user-name>YOUR_USER_NAME</user-name>
            <password>YOUR_PASSWORD</password>
        </security>
    </datasource>
</datasources>

You may also need to add the driver to the standalone.xml file :

 <drivers>
    ...
    <driver name="postgresql" module="org.postgresql">
        <driver-class>org.postgresql.Driver</driver-class>
        <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
    </driver>
    ...
</drivers>

NOTE : YOUR_TOOL_DATASOURCES can be found in TOOL-ds.xml file (/src/main/application/META-INF of your ear folder) or in the tool user manual.

Finally, restart your JBoss to take into account your config.