Hi all

I�ve got a problem with "Tomcat 5.0.16 Embedded" in our application.

A few days ago i�ve written a little bootstrapping class for our application. We use it so we do not have to add each jar to the classpath but can mention dir/*.jar in a config file.

The bootstrapper creats a URLClassloader, adds all jars/dirs mentioned in a cfg file, uises teh nw classloader to load the launcher class of the application and then launches the main method. After this, the application itself starts up tomcat embedded after some time.

During startup the following exception comes up:
20040125 22:26:39.515 INFO  org.apache.catalina.startup.Embedded  - Starting tomcat 
server
20040125 22:26:39.859 INFO  org.apache.catalina.core.StandardEngine  - Starting 
Servlet Engine: Apache Tomcat/5.0.16
20040125 22:26:39.875 INFO  org.apache.catalina.core.StandardHost  - XML validation 
disabled
java.lang.reflect.InvocationTargetException
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at at.inexess.bootstrap.Bootstrapper.main(Bootstrapper.java:147)
Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
       at java.lang.ClassLoader.defineClass0(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
       at 
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1653)
...


Thats how i launch tomcat in the app: embedded = new Embedded(); embedded.setDebug(0);

engine = embedded.createEngine();
engine.setName("test");
host = embedded.createHost("localhost", getPath() + "/embedws");
engine.setDefaultHost(host.getName());
engine.addChild(host);
Context context = embedded.createContext("", getPath() + "/embedws/webapps/ROOT");
host.addChild(context);
embedded.addEngine(engine);
connector = embedded.createConnector("0.0.0.0", getPort(), false);
embedded.addConnector(connector);


       try {
           embedded.start();
       } catch (Exception e) {
           logger.error("Could not start Tomcat:",e);
       }


The strange thing is that tomcat cannot find the HttpServlet class while loading the first context (which contains servlets).


All libraries in the lib directory ($CATALAINA_HOME/lib) are in the URL-List of the 
URLClassloader used by the bootstrapper class.
Looks like i�ve got a problem with the webapp-classloader...

Can anybody give me advice?

greets,
mike

PS: For further infos about the bootstrapper - i�ve placed it here: http://vis.at/Bootstrapper.java (its not done yet)



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



Reply via email to