tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Turner" <tur...@blackbear.com>
Subject Where to put ServletContextListener?
Date Tue, 02 Oct 2001 21:52:59 GMT
I'm trying to use a ServletContextListener to initialize Turbine
standalone for my application.  Here's the class:

package com.bfg.services;
import org.apache.turbine.util.TurbineConfig;

public class BfgListener implements javax.servlet.ServletContextListener
{
    public void contextDestroyed(javax.servlet.ServletContextEvent sce)
{
    }

    public void contextInitialized(javax.servlet.ServletContextEvent
sce) {
	TurbineConfig tc = new
TurbineConfig("/","TurbineResources.properties");
	tc.init();
	
    }
}

Here's the server.xml excerpt:
        <Context path="/bfg" docBase="bfg" debug="0"
                 reloadable="true">
	  <Listener className="com.bfg.services.BfgListener">

I've tried putting the class in the jar with the rest of the bfg
classes, in a jar in the tomcat lib directory, in the tomcat classes
directory, in the webapp lib and classes directory, and I still get the
same error on startup:

Catalina.start: java.lang.ClassNotFoundException:
com.bfg.services.BfgListener
java.lang.ClassNotFoundException: com.bfg.services.BfgListener

Where does it need to live?  I've seen the question asked on this list,
but not the answer.

James


Mime
View raw message