tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Charbonneau <>
Subject org.apache.naming
Date Fri, 24 Oct 2003 08:10:59 GMT
I was trying to embed Tomcat in my application only to discover that 
Embedded.createContext relies on ProxyDirContext from 
org.apache.naming.resources.  I can't seem to find the jar that contains this 
class, though I can find references to JavaDocs for it.  I'm running Tomcat 
4.1 and am a little confused.  Any help here would be appreciated.  :)

Here is the stack trace:

Exception in thread "main" java.lang.NoClassDefFoundError: 
	at org.apache.catalina.startup.Embedded.createContext(
	at com.look.core.EmbeddedTomcat.startTomcat(
	at com.look.core.Main.main(

And the class is a modified version of an example from an OnJava article, and 
is included here.

import org.apache.catalina.*;
import org.apache.catalina.logger.*;
import org.apache.catalina.startup.*;

 * @author etriaph
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
public class EmbeddedTomcat
	private String   m_path     = null;
	private Embedded m_embedded = null;
	private Host     m_host     = null;

	public EmbeddedTomcat()
	public EmbeddedTomcat(String path)
	public void setPath(String path)
		m_path = path;
	public void startTomcat() throws Exception
		Engine engine = null;
		System.setProperty("catalina.path", getPath());
		m_embedded = new Embedded();
		m_embedded.setLogger(new SystemOutLogger());
		engine = m_embedded.createEngine();
		m_host = m_embedded.createHost("localhost", getPath() + "/webapps");
		Context context = m_embedded.createContext("", getPath() + "/webapps/ROOT");
		Connector connector = m_embedded.createConnector(null, 8080, false);
	public String getPath()
		return( m_path );
	public void stopTomcat() throws Exception

Again, I would love to get an opinion on this, or perhaps a URL to a jar that 
contains the classes needed.

Thanks in advance!

Robert Charbonneau

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message