users@glassfish.java.net

Re: developing lifecycle module

From: Saloustros Georgios <gesalous_at_gmail.com>
Date: Wed, 19 Dec 2007 21:40:46 +0200

Ok I found the problem everything should be inside a .jar file
For the standalone server everything works ok.
What exactly happens in the case where a lifecycle module tha loads .so
libraries is deployed on a glassfish cluster setup?
What I am trying to do now is to code a lifecycle module that when it gets
the glassfish INIT_EVENT will execute System.load("mylib.so") for both
instances of my cluster(Both jvm should load the libraries). Is that
possible with a lifecycle module? Where the libraries should I put the .so
libraries?
2007/12/19, Saloustros Georgios <gesalous_at_gmail.com>:
>
> Hello.
> I am trying to develop a test lifecycle module for glassfish.
> As I read the documentation every time an LifeCycle Event arrives the
> application server calls the handleEvent method for every lifecycle
> module(right?)
> In glassfish's domain.xml file the lifecycle module is configured as
>
> *<lifecycle-module* class-name="Loader" classpath=
> "/root/NetBeansProjects/loader/build/classes/LifecycleModule" enabled="true"
> is-failure-fatal="true" name="loader"
> object-type="user"*/>*
>
> ...and the module
>
> package LifecycleModule;
>
> import com.sun.appserv.server.*;
>
>
>
> /**
> *
> * @author root
> */
> public class Loader implements com.sun.appserv.server.LifecycleListener
> {
>
> public void handleEvent(com.sun.appserv.server.LifecycleEvent event)
> {
>
> if (event.getEventType ()==event.INIT_EVENT)
> {
>
>
> System.out.println("got init event");
> }
>
> else if(event.getEventType()==event.READY_EVENT )
> {
> System.out.println("got ready event");
> }
>
> else if(event.getEventType()==event.STARTUP_EVENT)
> {
> System.out.println("got startup event");
> }
> else if(event.getEventType()==event.SHUTDOWN_EVENT)
> {
> System.out.println("got shutdown event");
> }
> else if(event.getEventType()==event.TERMINATION_EVENT)
> {
> System.out.println("got termination event");
> }
>
> else{ }
> }
>
>
>
>
> }
>
>
> }/*end of class Loader*/
>
> but in the server log I get a Loader class not found exception .
> What am I doing wrong?
> Thanks,
> GS
>