problem with running Servlet on Tomcat: InvocationTargetException

Posted by Fahim on Stack Overflow See other posts from Stack Overflow or by Fahim
Published on 2010-03-16T06:57:23Z Indexed on 2010/03/16 7:06 UTC
Read the original article Hit count: 311

Hi, I am new to Tomcat, and trying to run a simple HelloWorld servlet. I have installed Tomcat 6, and Jdk1.6 on Mandriva Linux, set CLASSPATH and JAVA_HOME. I have the following files and directories:

$CATALINA_HOME/webapps/MyApp/WEB_INF/classes/TestServlet.class
$CATALINA_HOME/webapps/MyApp/WEB_INF/web.xml

My web.xml file contains the following:

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

<description>ZibJana Localization</description>
<display-name>ZibJana Localization</display-name>             
<!-- Define the servlets for this application-->
<servlet>
    <servlet-name>ZibJana</servlet-name>
    <servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>ZibJana</servlet-name>
    <url-pattern>*</url-pattern>
</servlet-mapping>  

But when I try to invoke my servlet with url http://localhost:8080/MyApp, tomcat fails to launch launch the servlet. I checked in the $CATALINA_HOME/logs/catalina.out log-file and found the following error, which occurs every time I start tomcat service.

INFO: Deploying web application directory MyApp

16-Mar-2010 12:05:38 AM org.apache.tomcat.util.digester.Digester endElement SEVERE: End event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

Please let me know where my mistake is. Thanks in advance.

© Stack Overflow or respective owner

Related posts about tomcat6

Related posts about servlets