Friday Sep 06

Geronimo Datasource installation using a Deployment Plan

Sébastien Dante Ursini
PDF Print E-mail
Tuesday, 29 May 2012 13:35
Written by Sébastien Dante Ursini
AddThis Social Bookmark Button

Geronimo Datasource deployment plan installation

Geronimo Datasource installation using a Deployment Plan

Geronimo provides several administration channels; one of them is the command line administration interface or CLI from now on.

The CLI allows you to manage, administrate, and monitor any applications or modules which application server exposes to the administrators. So we can perform several deployment tasks just by firing up a terminal, navigating to Geronimo bin directory and executing the deploy script which is either a shell script in UNIX based operating systems or a batch file in Windows operating system.

Installing datasource on several developper's machine can be a very annoying tasks you can automate using the deploy shell command. In the following example i will demonstrate how to create a Derby datasource and how to deploy using a simple shell script

The following tutorial is based on Geronimo version 3.0

1) Define your datasource details

Create an xml file named datasource-plan.xml .


<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="">
    <dep:environment xmlns:dep="">
                    <config-property-setting name="DatabaseName">MyApplicationDB</config-property-setting>
                    <config-property-setting name="ShutdownDatabase"/>
                    <config-property-setting name="Password">mypassword</config-property-setting>
                    <config-property-setting name="UserName">myuser</config-property-setting>
                    <config-property-setting name="LoginTimeout"/>

2) Create a script to deploy your datasource

In this chapter we will create a script to deploy the datasource using the deploy command available in the bin directory of Geronimo .

In a Linux/Unix or Mac OSX system your script will look like :


sh $GERONIMO_HOME/bin/deploy deploy datasource-plan.xml $CONNECTOR

The first line define the location of your Geronimo installation
On line 2 the connector correponding to Derby Embedded
The last line execute the deploy command passing the datasource plan we just created and the reference to the correponding Derby connector

The same script for Windows :

dos-console deploy_datasource.bat

set GERONIMO_HOME=D:\programs\geronimo-3.0-beta-1-Jetty
set CONNECTOR=%GERONIMO_HOME%/repository/org/tranql/tranql-connector-derby-embed-local/1.7/tranql-connector-derby-embed-local-1.7.rar
%GERONIMO_HOME%/bin/deploy.bat deploy datasource-plan.xml %CONNECTOR% 

3) Executing the script

To execute the script you need to provide the administration login and password of your Geronimo instance.


>deploy.bat deploy datasource-plan.xml D:\programs\geronimo-3.0-beta-1-Jetty/repository/org/tranql/tranql-connector-derby-embed-local/1.7/tranql-connector-derby-embed-local-1.7.rar
Using GERONIMO_HOME:   D:\programs\geronimo-3.0-beta-1-Jetty
Using GERONIMO_TMPDIR: var\temp
Using JRE_HOME:        C:\programs\jdk1.6.0_23\jre
Username: system
Password: *******
    Deployed console.dbpool/MYApplicationDS/1.0/car

If you received the message provided in line 7 your datasource has been deployed in your Geronimo application server.

Tags: deploy , deployment , shell , create , geronimo , datasource , script , based , tasks
Sébastien Dante Ursini

Sébastien Dante Ursini

Java/Finance Specialist
17 Years of experience in Java
22 Year in Banking/Finance
Based in Geneva/Switzerland

Add comment

Security code

Java Tutorial on Facebook