Geronimo Installation
Apache Geronimo Installation
Out of the box you will have issues with Geronimo, but these are not hard to fix. This was the error I got that lead me down the path to writing this deployment guide for Geronimo:
Quick Steps
For the impatient, the steps to get it working are:
- Add Apache commons language to the repository
- Create a geronimo-web.xml file and add it to your war file
- Make your changes as per a normal installation (i.e., to the xwiki.cfg, hibernate.cfg.xml, etc.)
The optional steps I did were: - Add a higher version of commons-beanutils to repository
- Add a higher version of commons-fileupload to repository
- Add a higher version of commons-io to repository
Minimum XML Changes
Modify your geronimo-web.xml and add the following library to match how you installed the library into the repository:
<groupId>apache-commons</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
<type>jar</type>
</dependency>
All Changes
geronimo-web.xml
Here is a sample deployment resource xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
<!--
** GroupID : The grouping you put xwiki in, like your parent container I guess.
** ArtifactID : Same as the war name, full name + version.
** Version : A version of the software.
** Type : Type of deployment. In this case a WAR archive.
-->
<dep:moduleId>
<dep:groupId>default</dep:groupId>
<dep:artifactId>xwiki-enterprise-web-2.3.1</dep:artifactId>
<dep:version>1275530872796</dep:version>
<dep:type>war</dep:type>
</dep:moduleId>
<!--
** Configure the JDBC connection pool, in this case the pool is based on H2 database.
** It is here you would configure your oracle, postgres, mysql, sqlserver, etc pool drivers.
-->
<dep:dependencies>
<dep:dependency>
<dep:groupId>jdbc</dep:groupId>
<dep:artifactId>h2</dep:artifactId>
<dep:version>1.2.136</dep:version>
<dep:type>jar</dep:type>
</dep:dependency>
<!-- The location of the pool -->
<dependency>
<groupId>console.dbpool</groupId>
<artifactId>XWikiDS</artifactId>
</dependency>
</dep:dependencies>
<!-- Libraries
** This is where I specified the libraries that were out of date in geronimo
** that lead to it not working. There might be better ways, but this was how
** I did it to get it working quickly.
-->
<!-- Required -->
<dependency>
<groupId>apache-commons</groupId>
<artifactId>commons-lang</artifactId>
<version>2.5</version>
<type>jar</type>
</dependency>
<!-- Optional -->
<dependency>
<groupId>apache-commons</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<type>jar</type>
</dependency>
<!-- Optional -->
<dependency>
<groupId>apache-commons</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
<type>jar</type>
</dependency>
<!-- Optional -->
<dependency>
<groupId>apache-commons</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<type>jar</type>
</dependency>
</dep:environment>
<!-- Whatever the webroot you want, ie http://127.0.0.1/xwiki -->
<context-root>xwiki</context-root>
<!--
** Map the reference to the JDBC pool located at resource-link to the jndi location ref-name
-->
<resource-ref>
<ref-name>jdbc/XWikiDS</ref-name>
<resource-link>XWikiDS</resource-link>
</resource-ref>
</web-app>
Warnings In The Log File
I saw these in the log files and apparently you can just ignore them.
Using a JDBC Datasource
Navigate to Geronimo -> Services -> Database Pools and click the Using the Geronimo database pool wizard link.
Step 1: Select Name and Database
Name of Database Pool: <Pool Name>
A name that is different than the name of any other database pools in the server (no spaces in the name please).
Database Type: <Database Version>
The type of database the pool will connect to.
Step 2: Select Driver, JAR, Parameters
JDBC Driver Class: <driver> (e.g. org.h2.Driver)
Driver JAR: <jarfile for the driver> (e.g. jdbc/h2/1.2.136/jar)
DB User Name: <username>
DB Password: <password>
Confirm Password: <password>
Step 3: Final Pool Configuration
JDBC Connect URL: <url> (e.g. jdbc:h2:tcp://localhost/xwiki23)
Make sure the generated URL fits the syntax for your JDBC driver.
Driver Status: Loaded Successfully
Connection Pool Parameters
Transaction Type: LOCAL
Type of transactions that this connection pool supports.
Pool Min Size: 0
The minimum number of connections in the pool. Leave blank for default.
Pool Max Size: 10
The maximum number of connections in the pool. Leave blank for default.
Blocking Timeout: <default> (in milliseconds)
The length of time a caller will wait for a connection. Leave blank for default.
Idle Timeout: <default> (in minutes)