You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Stamatis Karvounarakis <ka...@gmail.com> on 2006/03/02 17:50:36 UTC

Load servlet on startup

Hello I have a servlet that I want to load on startup of jetspeed2. So I
have added the following fragment in web.xml of my own project as I used to
do in jetspeed1:
<servlet>
                <servlet-name>
                        init
                </servlet-name>
                <servlet-class>
                        gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>

Nevertheless,the servlet is not launched. Can someone explain to me what do
I do wrong?
Thanks a lot

Stamatis

Re: Load servlet on startup

Posted by Stamatis Karvounarakis <ka...@gmail.com>.
Thanx a lot,no windows for me:-)I will keep trying for the servlet

On 3/3/06, Philip Mark Donaghy <ph...@gmail.com> wrote:
>
> On 3/3/06, Stamatis Karvounarakis <ka...@gmail.com> wrote:
> > Thank for the answer. I have created a simple portal using the jetspeed2
> > guide to a simple portal. I have put the jar in the lets say
>
> It's good to see your taking the simple approach.
>
> > simple/WEB-INF/lib. Is this correct? One additional question. Since the
>
> This is correct.
>
> > portlet  is hot delpoyed in jetspeed2 in which startup will the servlet
> be
> > loaded? Do I have to restart tomcat, or it will be loaded upon the
>
> Yes it will.
>
> > deployment of the portlet?
>
> Tomcat startes the lifecycle of the web app context when portlets are
> deployed. You shouldn't have to restart tomcat even when you redeploy.
> There is the antijar looking problem on windows. The getting started
> with j2 says,
>
> "Tomcat 5.5.9 on Windows you have to set the global Context attribute
> "antiJARLocking" to true."
>
> In ${org.apache.jetspeed.server.home}\conf\context.xml use:
>
>
>     <Context antiJARLocking="true">
>     ...
>     </Context>
>
> The only problem that I have had with Tomcat hot deploy is when you
> use singletons. You have to be sure to reinitialize the static
> variables in any of your classes.
>
> >
> > Thanks again
> >
> > On 3/2/06, David Sean Taylor <da...@bluesunrise.com> wrote:
> > >
> > > Stamatis Karvounarakis wrote:
> > > > Hello I have a servlet that I want to load on startup of jetspeed2.
> So I
> > > > have added the following fragment in web.xml of my own project as I
> used
> > > to
> > > > do in jetspeed1:
> > > > <servlet>
> > > >                 <servlet-name>
> > > >                         init
> > > >                 </servlet-name>
> > > >                 <servlet-class>
> > > >
> > > gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
> > > >                 </servlet-class>
> > > >                 <load-on-startup>1</load-on-startup>
> > > >         </servlet>
> > > >
> > > > Nevertheless,the servlet is not launched. Can someone explain to me
> what
> > > do
> > > > I do wrong?
> > > > Thanks a lot
> > > >
> > > > Stamatis
> > > >
> > > Where did you put the class
> > >
> > > gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
> > >
> > > Assuming you want it to start up in Jetspeed's context, it has to go
> in
> > > Jetspeed's classpath, usually as a jar file in WEB-INF/lib or a class
> > > file fully qualified under WEB-INF/classes
> > >
> > > Also, be careful where you place the <servlet> definition in the
> web.xml
> > > as XML element definitions there are DTD validated
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> > >
> > >
> >
> >
>
>
> --
> Philip Donaghy
> donaghy.blogspot.com del.icio.us/donaghy/philip
> Skype: philipmarkdonaghy
> Office: +33 5 56 60 88 02
> Mobile: +33 6 20 83 22 62
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Load servlet on startup

Posted by Philip Mark Donaghy <ph...@gmail.com>.
On 3/3/06, Stamatis Karvounarakis <ka...@gmail.com> wrote:
> Thank for the answer. I have created a simple portal using the jetspeed2
> guide to a simple portal. I have put the jar in the lets say

It's good to see your taking the simple approach.

> simple/WEB-INF/lib. Is this correct? One additional question. Since the

This is correct.

> portlet  is hot delpoyed in jetspeed2 in which startup will the servlet be
> loaded? Do I have to restart tomcat, or it will be loaded upon the

Yes it will.

> deployment of the portlet?

Tomcat startes the lifecycle of the web app context when portlets are
deployed. You shouldn't have to restart tomcat even when you redeploy.
There is the antijar looking problem on windows. The getting started
with j2 says,

"Tomcat 5.5.9 on Windows you have to set the global Context attribute
"antiJARLocking" to true."

In ${org.apache.jetspeed.server.home}\conf\context.xml use:

						
    <Context antiJARLocking="true">
    ...
    </Context>

The only problem that I have had with Tomcat hot deploy is when you
use singletons. You have to be sure to reinitialize the static
variables in any of your classes.

>
> Thanks again
>
> On 3/2/06, David Sean Taylor <da...@bluesunrise.com> wrote:
> >
> > Stamatis Karvounarakis wrote:
> > > Hello I have a servlet that I want to load on startup of jetspeed2. So I
> > > have added the following fragment in web.xml of my own project as I used
> > to
> > > do in jetspeed1:
> > > <servlet>
> > >                 <servlet-name>
> > >                         init
> > >                 </servlet-name>
> > >                 <servlet-class>
> > >
> > gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
> > >                 </servlet-class>
> > >                 <load-on-startup>1</load-on-startup>
> > >         </servlet>
> > >
> > > Nevertheless,the servlet is not launched. Can someone explain to me what
> > do
> > > I do wrong?
> > > Thanks a lot
> > >
> > > Stamatis
> > >
> > Where did you put the class
> >
> > gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
> >
> > Assuming you want it to start up in Jetspeed's context, it has to go in
> > Jetspeed's classpath, usually as a jar file in WEB-INF/lib or a class
> > file fully qualified under WEB-INF/classes
> >
> > Also, be careful where you place the <servlet> definition in the web.xml
> > as XML element definitions there are DTD validated
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>
>


--
Philip Donaghy
donaghy.blogspot.com del.icio.us/donaghy/philip
Skype: philipmarkdonaghy
Office: +33 5 56 60 88 02
Mobile: +33 6 20 83 22 62

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Load servlet on startup

Posted by Stamatis Karvounarakis <ka...@gmail.com>.
Thank for the answer. I have created a simple portal using the jetspeed2
guide to a simple portal. I have put the jar in the lets say
simple/WEB-INF/lib. Is this correct? One additional question. Since the
portlet  is hot delpoyed in jetspeed2 in which startup will the servlet be
loaded? Do I have to restart tomcat, or it will be loaded upon the
deployment of the portlet?

Thanks again

On 3/2/06, David Sean Taylor <da...@bluesunrise.com> wrote:
>
> Stamatis Karvounarakis wrote:
> > Hello I have a servlet that I want to load on startup of jetspeed2. So I
> > have added the following fragment in web.xml of my own project as I used
> to
> > do in jetspeed1:
> > <servlet>
> >                 <servlet-name>
> >                         init
> >                 </servlet-name>
> >                 <servlet-class>
> >
> gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
> >                 </servlet-class>
> >                 <load-on-startup>1</load-on-startup>
> >         </servlet>
> >
> > Nevertheless,the servlet is not launched. Can someone explain to me what
> do
> > I do wrong?
> > Thanks a lot
> >
> > Stamatis
> >
> Where did you put the class
>
> gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
>
> Assuming you want it to start up in Jetspeed's context, it has to go in
> Jetspeed's classpath, usually as a jar file in WEB-INF/lib or a class
> file fully qualified under WEB-INF/classes
>
> Also, be careful where you place the <servlet> definition in the web.xml
> as XML element definitions there are DTD validated
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

Re: Load servlet on startup

Posted by David Sean Taylor <da...@bluesunrise.com>.
Stamatis Karvounarakis wrote:
> Hello I have a servlet that I want to load on startup of jetspeed2. So I
> have added the following fragment in web.xml of my own project as I used to
> do in jetspeed1:
> <servlet>
>                 <servlet-name>
>                         init
>                 </servlet-name>
>                 <servlet-class>
>                         gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet
>                 </servlet-class>
>                 <load-on-startup>1</load-on-startup>
>         </servlet>
> 
> Nevertheless,the servlet is not launched. Can someone explain to me what do
> I do wrong?
> Thanks a lot
> 
> Stamatis
> 
Where did you put the class

gr.ics.forth.SWPG.appserver.web.impl.CWEBInitServlet

Assuming you want it to start up in Jetspeed's context, it has to go in 
Jetspeed's classpath, usually as a jar file in WEB-INF/lib or a class 
file fully qualified under WEB-INF/classes

Also, be careful where you place the <servlet> definition in the web.xml 
as XML element definitions there are DTD validated

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org