Hi,

thanks for the answer, now I think I know where I got wrong. Listener
elements are tomcat server extensions rather than web app elements. But this
leads to my next question: how can I define web app sepcific listeners?
My goal is to have some application wide global jobs like reading
configuration etc. done when the application is brought up and do some
cleanup when it stops. And the object created by this process should be
accessable through the servlet context. I tried to find something like this
in the docs but so far I haven't been successfull - maybe anyone can give me
a hint under what topic to look?

Many thanks in advance
Tobi


----- Original Message -----
From: "Bill Barker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 21, 2002 7:58 AM
Subject: Re: Listener Element in Context: class not found Exception


>
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello there,
> >
> > I have a problem with the <Listener> element inside a <Context> element
> >
> > in the server.xml configuration file. I always get a ClassNotFound
> > Exception for the class I specify in the attribute className when I
> > try to start catalina.
> >
> > I defined a Listener like this:
> >
> > <Host name="localhost" debug="1" appBase="webapps"
> >        unpackWARs="true" autoDeploy="true">
> >  [..]
> >   <Context path="/myapp" docBase="myapp" debug="1">
> >     <Listener className="com.mypackage.ListenerClass"/>
> >   </Context>
> >  [..]
> > </Host>
> >
> > The corresponding com.mypackage.ListenerClass resides inside it's web
> > application directory webapps/myapp/WEB-INF/classes. Now when I try to
>
> And that would be your problem ;-).  A Catalina Listener class can't be
> web-app specific.  You will need to move your class file to
> $CATALINA_HOME/server/classes.
>
> >
> > start the server I get a ClassNotFoundException for
> > com.mypackage.ListenerClass ...
> >
> > Now where do I have to put the classes so catalina can find them or is
> >
> > there a configuration file where I can point to this class? Supporting
> > a classpath doesn't help as catalina is setting it's own classpath.
> >
> > Any hints would be appreciated
> > Tobi


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to