users@glassfish.java.net

Deployment of LifecycleListener module

From: <glassfish_at_javadesktop.org>
Date: Wed, 15 Oct 2008 07:53:14 PDT

Hi,

I'm developing an application for which some initialization must be done upon startup / deployment. This is mainly logging and configuration initialization. Because we don't have any need for a web-interface in our application EAR, I did some searching and decided to use the LifecycleListener interface for Glassfish.

I have got the LifecycleListener module working when deployed following the guidelines in the Glassfish developer guide (https://glassfish.dev.java.net/javaee5/docs/DG/beamc.html). The class-files are placed in <domain>/lib/classes.
The problem however is that we would like to deliver our application as a single packaged EAR, for easy deployment. I have been trying some things, but somehow Glassfish doesn't start the LifecycleListener when it is deployed anywhere else than in the <domain>/lib directory. Even not when deployed as jar in the <domain>/applications/lifecycle-module/ directory (or I must be missing something).

I would like to know if there is some way to deploy our application as a single EAR (containing persistence entities, beans, connectors, etc) and get the Lifecycle module running upon Glassfish startup? I'm using Glassfish v2. Would like to hear if anybody has some experience with this.

Also looking into some alternative solutions I came accross using custom MBeans as suggested somewhere, but this seems quite cumbersome. Other alternatives which solve my problem are more then welcome.

Thanks!
[Message sent by forum member 'mdonkers' (mdonkers)]

http://forums.java.net/jive/thread.jspa?messageID=307506