You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Matthew A. Giedt 99" <Ma...@Alum.Dartmouth.ORG> on 2001/10/23 02:55:36 UTC

Embeded Tomcat and Context Issues

I am trying to embed Tomcat (3.2.3) into my application and am aware of
the EmbeddedTomcat class. I would like, however, to use the main Tomcat
executable as I would like to be able to simply 'plug-in' other servlet
engines and like the XML based server.xml over hard-coding the initial
startup configuration.
 
That being said, I am essentially doing the following 

classname = org.apache.tomcat.startup.Tomcat
method = main
argv = new String[0]

public void servletStarter 	(
			String classname, 
			String method,
			String [] argv
			)
{
            Object [] argc = new Object[1];
            argc[0] = argv;
            Method[] methods = Class.forName(classname).getMethods();
            for(int i=0; i<methods.length; i++)
            {
                if(methods[i].getName().equals(method))
                {
                    methods[i].invoke(methods[i].getName(), argc);
                    return;
                }
            }
 }


My start script for the application sets -Dtomcat.home appropriately and
Tomcat starts inside the application.
 
I get the following output 
 
TOMCAT HOME ::c:\downloads\apache\jakarta\tomcat\jakarta-tomcat-3.2.3
2001-10-22 19:28:00 - ContextManager: Adding context Ctx( /examples )
2001-10-22 19:28:00 - ContextManager: Adding context Ctx( /admin )
2001-10-22 19:28:00 - ContextManager: Adding context Ctx( /foo )
Starting tomcat. Check logs/tomcat.log for error messages
2001-10-22 19:28:00 - ContextManager: Adding context Ctx(  )
2001-10-22 19:28:00 - ContextManager: Adding context Ctx( /test )
cannot load servlet name: jsp: org.apache.jasper.servlet.JspServlet
cannot load servlet name: jsp: org.apache.jasper.servlet.JspServlet
cannot load servlet name: jsp: org.apache.jasper.servlet.JspServlet
cannot load servlet name: jsp: org.apache.jasper.servlet.JspServlet
cannot load servlet name: jsp: org.apache.jasper.servlet.JspServlet
2001-10-22 19:28:01 - PoolTcpConnector: Starting HttpConnectionHandler
on 8080
2001-10-22 19:28:01 - PoolTcpConnector: Starting Ajp12ConnectionHandler
on 8007
 
Obviously, for each context I am initializing, the 'cannot load servlet
name: jsp: org.apache.jasper.servlet.JspServlet' error is being
displayed. This also happens when trying to use EmbededTomcat. I cannot
display JSP pages using the Tomcat instance through Apache or the
Webserver on port 8080. The 'org.apache.jasper.servlet.JspServlet' is in
my classpath. Everything works perfectly when started from the tomcat.bat file.
 
Any help would be greatly appreciated.
-Matt