Log In | Sign Up   View a printable version of the current page.
  Dashboard > [fleXive] > ... > How-Tos > Deploy in Geronimo 2.2

Added by Markus Plesser, last edited by Markus Plesser on Jan 09, 2012  (view change) show comment
Labels: 
(None)

How to deploy in Geronimo 2.2

While Geronimo 2.2 is now fully supported in the 3.1 development branch, a few tweaks have to be applied to work well with the bundled MyFaces 1.2.3 implementation.

Getting Geronimo

Geronimo v2.2 can be downloaded here.
Do not use Geronimo v2.1.4 as there are problems running flexive on it!
So far we only tested the Java EE 5 Certified builds with bundled Tomcat 6.

Unpack Geronimo to a directory of your choice and make sure to provide a bigger-than-default permGen space by adding this line to bin/geronimo.sh (see also this post):

export JAVA_OPTS="-XX:MaxPermSize=128m -Xmx1024m"

To start Geronimo type geronimo.[sh|bat] run or geronimo.[sh|bat] jpda run if you want debugging at port 8000 enabled.

Once started go to http://localhost:8080/console and log in using the user system with password manager.

If you do have issues launching Geronimo you might have a port or address issue which can be resolved by editing var/config/config-substitutions.properties

Tweaking [fleXive] to work with MyFaces

There is a bug/feature/issue that prevents using MyFaces with state saving on the server: ViewExpiredException's will be thrown. This might be an issue related to facelets.

To enable client side state saving, the following context parameter must be set in web.xml:

<context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
</context-param>

Now everything will run fine, with one minor annoyance: MyFaces issues (very long!) warnings when a JSF component is added programatically without explicitly defining an id. This is fine by the Sun reference implementation and not violating the specification.

The solution is to turn off warning log messages for the affected MyFaces class. Edit the file server-log4j.properties found in <geronimo base>/var/log and add the following line at the end of the file:

log4j.logger.javax.faces.component.UIComponentBase=ERROR

Configuration

While the preferred way to deploy applications to Geronimo is using a deployment plan that contains database drivers and configuration we choose to configure our database drivers and pools globally. The reason is we want to be able to configure needed JDBC resources with our own division configuration (web-)application instead of hardcoding them into the .ear.

Setting up the resources is rather simple and straight-forward:

Database driver

  • Go to Services -> Repository
  • Select mysql-connector-java-5.0.8-bin.jar (or appropriate version) from flexive/lib or download it from MySQL
  • Group: mysql
  • Click install

Configuration Database

  • Go to Services -> Database Pools
  • Click Using the Geronimo database pool wizard
  • Name of Database Pool: flexiveConfiguration
  • Database Type: MySQL-XA
  • Click Next
  • Select the mysql-connector we uploaded
  • User Name: root
  • Database Name: flexiveConfiguration
  • Password: a
  • Confirm Password: a
  • Click Deploy

First division

Transactional datasource:

  • Go to Services -> Database Pools
  • Click Using the Geronimo database pool wizard
  • Name of Database Pool: flexiveDivision1
  • Database Type: MySQL-XA
  • Click Next
  • Select the mysql-connector we uploaded
  • User Name: root
  • Database Name: flexive
  • Password: a
  • Confirm Password: a
  • Click Deploy

Non transactional datasource:

  • Go to Services -> Database Pools
  • Click Using the Geronimo database pool wizard
  • Name of Database Pool: flexiveDivision1NoTX
  • Database Type: MySQL
  • Click Next
  • Select the mysql-connector we uploaded
  • User Name: root
  • Database Name: flexive
  • Password: a
  • Confirm Password: a
  • Click Deploy

Deployment

  • Go to Applications -> Deploy New
  • Archive: Select your flexive.ear
  • Keep Start app after install checked
  • Click Install

You should after a few moments be able to access [fleXive] from http://localhost:8080/flexive/adm/

Useful links:

Using JNDI in Geronimo
Configuring database pools
Remote JNDI lookup
How to obtain a global JDBC Connection
Three ways to connect a database to a Geronimo application server
JBoss to Geronimo JDBC migration

Site running on a free Atlassian Confluence Open Source Project License granted to [fleXive] . Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.6.1 Build:#916 Nov 09, 2007) - Bug/feature request - Contact Administrators