users@glassfish.java.net

Re: Start RUn when Glassfish start ...HOW ?

From: Trond Strømme <Trond.Stromme_at_Sun.COM>
Date: Fri, 13 Nov 2009 12:59:54 +0100

Hi Suleimankh,
If you need a servlet to start when the war file is deployed then in
web.xml set something like this:
<servlet>
    <servlet-name>SomeServlet</servlet-name>
    <display-name>SomeServlet</display-name>
    <servlet-class>com.mypackage.SomeServlet</servlet-class>
    <load-on-startup>1</load-on-startup> <-- this is the
important bit, see the servlet specification for more details -->
</servlet>

or if you want to run something when the server stars look at:
http://docs.sun.com/app/docs/doc/820-4336/beamc?a=view
you need to implement a class that implements the
com.sun.appserv.server.LifecycleListener interface

-- 
Trond Strømme
Application Platform Ambassador
Sun Microsystems Nordic, Professional Services
+47 975 09 388
http://blog.sun.com/tronds
glassfish_at_javadesktop.org wrote:
> hey,,
>
> it look simple.. but till now i couldnt find a way to do that..
> i need to start a java class or servlet  (thread) to run when glassfish server start ..
>
> anyone know how.. and in a simple way if it available 
>
> THX !!!
> [Message sent by forum member 'suleimankh' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=371612
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>