Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
TC 5.0.16 - Embedded / Classloading problem

TC 5.0.16 - Embedded / Classloading problem

2004-01-25       - By Michael Mangeng

 Back
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 Source code of org.apache.catalina.startup.Embedded  - Starting
tomcat server
20040125 22:26:39.859 INFO  org.apache.catalina.core.StandardEngine Source code of org.apache.catalina.core.StandardEngine  - Starting
Servlet Engine: Apache Tomcat/5.0.16
20040125 22:26:39.875 INFO  org.apache.catalina.core.StandardHost Source code of org.apache.catalina.core.StandardHost  - XML
validation disabled
java.lang.reflect.InvocationTargetException Source code of 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 Source code of java.lang.reflect.Method(Method.java:324)
       at at.inexess.bootstrap.Bootstrapper.main(Bootstrapper.java:147)
Caused by: java.lang.NoClassDefFoundError Source code of java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
       at java.lang.ClassLoader Source code of java.lang.ClassLoader(Native Method)
       at java.lang.ClassLoader Source code of java.lang.ClassLoader(ClassLoader.java:537)
       at java.security.SecureClassLoader Source code of java.security.SecureClassLoader(SecureClassLoader.java
:123)
       at org.apache.catalina.loader.WebappClassLoader Source code of org.apache.catalina.loader.WebappClassLoader
(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: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)




©2008 junlu.com - Jax Systems, LLC, U.S.A.