How to execute  servlets  in tomcat?

Hi,
I have compiled servlet file and tried to execute that file from root i.e. (http://localhost/'filename'....)as class file is in web-inf/classes.But it is executing from "http://localhost/servlet/" where is that servlet directory?
why all servlets executes from "servlet/" directory?
Please reply....
Thanx in advance.

I has the same problem, and my solution was to include a line in the tomcat-auto file foreach servlet i had.
Under
JkMount /MyApp/servlet/* ajp13
I set a line
JkMount /MyApp/MyServlet ajp13
and in the web.xml of my webapp i included a servlet mapping for the servlet:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>MyPackage.MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet</url-pattern>
</servlet-mapping>
Then restarting tomcat and apache it worked.
One question i have is that tomcat-auto file it is supposed to be auto-generated by tomcat, but in my case it is not, each time i add an app in the webapps dir i have to add all the stuff in tomcat-auto file. Does anyone know how to autogenerate this file?

Similar Messages

  • How to execute servlet in tomcat

    i have one jsp which is in the folder:- webapps/examples/Contact.jsp this is the code of contact.jsp:-
    <jsp:include page="Home.jsp" flush="true"/>
    <SCRIPT LANGUAGE="JavaScript1.1">
    function submission1() {
    if(document.contactus.name.value =="" )
         alert("please fill the Name");
              return;
         else if(document.contactus.organization.value =="")
         alert("please fill the organization");
         return;
         else if(document.contactus.designation.value =="")
    alert("please fill the designation");
    return;
         else if(document.contactus.telephone.value =="")
    alert("please fill the telephone");
    return;
         else if(document.contactus.city.value =="")
    alert("please fill the city/Country");
    return;
         else if(document.contactus.message.value =="")
    alert("please fill the message");
    return;
    document.forms[0].action = "MailServlet";
    document.forms[0].submit();
    </SCRIPT>
    <body>
    <form method="post" name="contactus">
    <TABLE BORDER=0 CELLPADDING=4>
    <TR>
    <TD ALIGN=RIGHT width="124"><b>Mail Server Host</b></TD>
    <TD ALIGN=LEFT width="298">
    <% String l_svr = (String)session.getAttribute("smtpServer"); %>
    <INPUT TYPE="text" NAME="p_smtpServer" SIZE=60
    VALUE="<%= l_svr!=null ? l_svr : "" %>" >
    </TD>
    </TR>
    <TR>
    <TD ALIGN=RIGHT width="124"><b>Name</b></TD>
    <TD ALIGN=LEFT width="298">
    <INPUT TYPE=TEXT SIZE=60 MAXLENGTH=60 NAME="name">
    </TD>
    </TR>
    <TR>
    <TD ALIGN=RIGHT width="124"><b> Name of Organization *</b> </TD>
    <TD ALIGN=LEFT width="298">
    <INPUT TYPE=TEXT SIZE=60 MAXLENGTH=200 NAME="organization">
    </TD>
    </TR>
              <TR>
    <TD ALIGN=RIGHT width="124"> <b>Your Designation *</b> </TD>
    <TD ALIGN=LEFT width="298">
    <INPUT TYPE=TEXT SIZE=60 MAXLENGTH=200 NAME="designation">
    </TD>
    </TR>
    <TR>
    <TD ALIGN=RIGHT width="124"><b> Telephone No.</b> </TD>
    <TD ALIGN=LEFT width="298">
    <INPUT TYPE=TEXT SIZE=60 MAXLENGTH=100 NAME="telephone">
    </TD>
    </TR>
    <TR>
    <TD ALIGN=RIGHT width="124"><b> City /Country </b></TD>
    <TD ALIGN=LEFT width="298">
    <INPUT TYPE=TEXT SIZE=60 MAXLENGTH=100 NAME="city">
    </TD>
    </TR>
    </TABLE>
    <b>Message</b><br>
    <TEXTAREA NAME="message" ROWS=10 COLS=66 SIZE=2000 WRAP=HARD></TEXTAREA>
    <BR><BR>
    <CENTER>
    <INPUT TYPE=BUTTON VALUE=" Send " onClick="submission1();">
    <INPUT TYPE=RESET VALUE="Reset Form"><br>
    </CENTER>
    </form>
    </body>
    </html>
    on submit of this jsp i call the Servlet which is in the folder
    webapps/examples/web-inf/classes/Mailservlet.java
    i also write web.xml which is in the folder
    \webapps\examples\WEB-INF\web.xml
    i write the code as :
    <web-app>
    <servlet>
    <servlet-name>MailServlet</servlet-name>
    <servlet-class> MailServlet </servlet-class>
              </servlet>
    <servlet-mapping>
    <servlet-name>
    MailServlet
    </servlet-name>
    <url-pattern>
    MailServlet
    </url-pattern>
    </servlet-mapping>
    </web-app>
    but when i tried to run it the after submitting the page (Contact.jsp) i found one erro in the IE "The page cannot be found".
    So any can help me out where i am wrong after looking the code.

    Too much unformatted code for me to browse through, use code tags please.
    One thing struck me though:
    >        <url-pattern>
    MailServlet
    </url-pattern>
    </servlet-mapping>
    </web-app>should probably be:
    <url-pattern>
       /MailServlet //notice the /
    </url-pattern>Have you tried accessing the Servlet by typing out the URL? Does that work?
    Also, http://nogoodatcoding.googlepages.com/deployingaservletontomcat

  • How to run servlets in tomcat

    Hi ,
    How to run servlets in tomcat server. I created two files html and servlet file.
    Html file
    callservlet.html
    <html>
    <body>
    <form method=post action="servletcalled.class">
    <input type=submit value="submit">
    </form>
    <body>
    </html>
    servlet file
    servletcalled.java contains
    public void doPost(HttpServletRequest req,HttpServletResponse res ){
    java.io.PrintWriter out = req.getWriter();
    out.println("Hi, executed");
    i put the callservlet.html in webapps/examples/ and servletcalled.class was in webapps/examples/Web-inf/classes/
    After starting the tomcat and running the program html file is getting exceuted but when i click on the submit button this error is prompted
    type Status report
    message servletcalled.class
    description The requested resource (servletcalled.class) is not available.
    Thanks in advance

    Thanks,
    I created a new directory in webapps
    s "webapps/test".
    Test directory contains
    1. callservlet.html file
    2. another directory Web-inf (i.e,
    webapps/test/Web-inf)
    Web-inf directory contains
    1. web.xml file
    2. another directory classes (i.e,
    webapps/test/Web-inf/calsses)
    classes directory contains
    1. servletcalled.class file
    web.xml file contains
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>Example</servlet-name>
    <servlet-class>Example</servlet-class>
    </servlet>
    </web-app>
    -->should be: <servlet-class>servletcalled</servlet-called>
    then in the <web-app> scope define this:
    <servlet-mapping>
    <servlet-name>Example</servlet-name>
    <url-pattern>/servlets/Example</url-pattern>
    </servlet-mapping>
    >
    thanks in advance i am working hard on that but
    notable to get the solutionbtw by reading the documentation of tomcat and tutorials of jave on the java site (here), you would have known this!

  • How to Run servlet in Tomcat 5.5.9

    hi
    How to run servlet in tomcat 5.5.9?how to set context path in server.xml of conf folder in tomcat since there is no context tag in server.xml.
    Jiten

    Hi ! I have a similar problem, well, it's along the same line ...
    I'm using NetBeans 4.1, and i've coded a servlet. Using NetBeans to launch my servlet (with the bundled Tomcat 5.5.7) works fine, however i need to deploy my application unto a Tomcat 5.5.9 server.
    Thus, i copied the WAR file generated by NetBeans into the Tomcat 5.5.9 webapps directory, and Tomcat expands it.
    Problem is when i run my JSP pages with the form tags, they do not work on the Tomcat 5.5.9 environment. Anyone knows why?
    (These work on the NetBeans Tomcat bundle 5.5.7)
    My form action :
    <form name="index" method="get" action="PageServlet">
    My web.xml :
    <servlet>
    <servlet-name>PageServlet</servlet-name>
    <servlet-class>application.PageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>PageServlet</servlet-name>
    <url-pattern>/PageServlet</url-pattern>
    </servlet-mapping>
    I'm really stumbed on why it doesn't work in Tomcat 5.5.9, any help is greatly appreciated, thanks in advance ^_^

  • How to run Servlet in Tomcat 5.5.7 Server

    Hi,
    How to run Servlet in Tomcat 5.5.7 Server. I mean where I should copy my *.class file.
    Thanks in Advance.
    bbye.

    In order to complile the servlet you need to tell java where to find the servlet libary (as stated above by setting the class path). or (much easier IMO)
    copy the servlet-api.jar to
    JavaInstallDirectory\jre\lib\ext

  • Executing Servlets thru Tomcat 5.5.17.

    I have just installet Tomcat 5.5.17 in order to execute Servlets.
    Though the service is running,I am unable to access it.
    When I say:
    http://localhost:8080
    it prompts me with a username and password screen:
    I enter 'admin' as the user name and password is blank:
    but am unable to go to the tomcat page.
    Has anyone encountered this before?
    I even tried entering 'tomcat' as user and 'tomcat' as password.

    I enter 'admin' as the user name and password is
    blank:
    but am unable to go to the tomcat page.
    Has anyone encountered this before?
    I even tried entering 'tomcat' as user and 'tomcat'
    as password.How about admin/admin?
    Anyway, those credentials should be there, in some xml configuration file (admin.xml ? -- don't remember).

  • How to run servlet with tomcat

    I have a probrom that how can I run servlet with tomcat?
    I have new a folder classes in webapps\root\WEB-INF\,and put the .class
    programme in it ,but http://localhost:8080/servlet/HelloWorldExample
    can't run ,it give me a error than http:404 not found.
    could you tell me how i can solve the problem.
    Thank u very much.

    Hi,
    Make sure the class is in classpath or in WEB-INF/classes folder and make an entry for servlet tag in web.xml in WEB-INF folder.
    Regards

  • Execute servlet in TomCat

    how can i Execute servlet in tomcat4.1?
    is there any setting?if yes what is that?
    already i installed jsdk
    and set the class path
    where i want to save servlet file?

    how can i Execute servlet in tomcat4.1?yes.
    is there any setting?if yes what is that?
    already i installed jsdk
    and set the class path
    where i want to save servlet file?These are very basic questions. You should read some tutorial and be more specific with your questions.
    http://www.coreservlets.com/
    Even while describing your basic problems, it is a good idea to describe what you have followed so far and which is the confusing step.

  • How to DEPOLY servlet to TOMCAT

    Hi,
    I try to run Servlet from TOMCAT, but it has error. Please give me some help!
    The Servlet is to access Oracle DB. V8i. from the Travel DB that I download from Oracle site. I use Jdeveloper 3.1.1.2 to create this project. It compiles and runs fine in Jdeveloper. When I try to deploy it to TOMCAT, it has the following error message:
    Error: 500
    Location: /examples/servlet/test/test
    Internal Servlet Error:
    java.lang.NullPointerException
    at java.lang.ClassLoader.resolveClass0(Native Method)
    at java.lang.ClassLoader.resolveClass(ClassLoader.java:588)
    at org.apache.tomcat.loader.AdaptiveClassLoader.loadClass(AdaptiveClassLoader.java:430)
    at org.apache.tomcat.loader.AdaptiveServletLoader.loadClass(AdaptiveServletLoader.java:174)
    at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:265)
    at org.apache.tomcat.core.ServletWrapper.init(ServletWrapper.java:289)
    at org.apache.tomcat.core.Handler.service(Handler.java:254)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
    at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
    at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
    at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
    at java.lang.Thread.run(Thread.java:484)
    It looks to me like Tomcat cannot fine the lib files.
    Also, the test.jar deployment file has sub directory. If I unzip them to F:\tomcat\jakarta-tomcat-3.2\webapps\examples\WEB-INF\classes, it will create several sub directories and jar files. How can I run the test.class file, if the file is in a sub directory say myproject? Can Tomcat get the lib and attachment file from all the sub directory?
    Thanks very much.
    kenny
    null

    You need to include the Oracle db jars (see your project properties) in your tomcat enviroment..
    This is done on Windows by changing the classpath section of tomcat-dir\bin\tomcat.bat. On Unix this is done simply by dropping the jar file in the tomcat-dir/lib directory.
    /Christian Bjxrnbak

  • How to run Servlet in TOMCAT

    I am new to Java Servlets. I am trying to run a servlet on TOMCAT but I don't know where to place my Servlet class file. TOMCAT works ok with sample jar file. Please guide.
    -- HTML code
    <HTML>
    <HEAD>
    <TITLE> Request Object </TITLE>
    </HEAD>
    <BODY>
    <FORM METHOD="POST" ACTION="/servlet/WelcomeServlet">
    Enter your Name: <INPUT TYPE=TEXT NAME="myName">
    <INPUT TYPE="SUBMIT" VALUE="Send Name">
    </FORM>
    </BODY>
    </HTML>
    -- Servlet Code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class WelcomeServlet extends HttpServlet {
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    String Name = request.getParameter("myName");
    PrintWriter out = response.getWriter();
    String mName = "test";
    try {
    mName = gName("AAA","VVV");
    catch (SQLException ex)
    out.println("SQLException");
    out.println("Welcome 1.1 " + Name + " !" + " mName " + mName);
    public String gName(String inputUserid, String inputPwd)
    throws SQLException{
    String vname = "Test";
    return vname;
    thanks
    Vineet

    I have Tomcat version 4.0 installed on my machine. If you look at the directory where you have Tomcat installed, you should find the directory structure:
    tomcat-folder/webapps/root/web-inf/classes
    Try placing your class files in the classes folder.

  • Newbie question: how to compile servlet using tomcat?? Thank you

    How to set classpath? How to compile servlet.java?

    jsp is also converted into a servlet .java nd then into a class file
    this is index.jsp
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>untitled</title>
      </head>
      <body>
      </body>
    </html>this is _index.java
    /*@lineinfo:filename=/index.jsp*/
      /*@lineinfo:generated-code*/
    import oracle.jsp.runtime.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.servlet.jsp.*;
    public class _index extends com.orionserver.http.OrionHttpJspPage {
      public final String _globalsClassName = null;
      // ** Begin Declarations
      // ** End Declarations
      public void _jspService(HttpServletRequest request, HttpServletResponse response) throws java.io.IOException, ServletException {
        response.setContentType( "text/html;charset=windows-1252");
        /* set up the intrinsic variables using the pageContext goober:
        ** session = HttpSession
        ** application = ServletContext
        ** out = JspWriter
        ** page = this
        ** config = ServletConfig
        ** all session/app beans declared in globals.jsa
        PageContext pageContext = JspFactory.getDefaultFactory().getPageContext( this, request, response, null, true, JspWriter.DEFAULT_BUFFER, true);
        // Note: this is not emitted if the session directive == false
        HttpSession session = pageContext.getSession();
        if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) {
          pageContext.setAttribute(OracleJspRuntime.JSP_PAGE_DONTNOTIFY, "true", PageContext.PAGE_SCOPE);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
          return;
        int __jsp_tag_starteval;
        ServletContext application = pageContext.getServletContext();
        JspWriter out = pageContext.getOut();
        _index page = this;
        ServletConfig config = pageContext.getServletConfig();
        try {
          // global beans
          // end global beans
          out.write(__oracle_jsp_text[0]);
        catch( Throwable e) {
          try {
            if (out != null) out.clear();
          catch( Exception clearException) {
          pageContext.handlePageException( e);
        finally {
          OracleJspRuntime.extraHandlePCFinally(pageContext,false);
          JspFactory.getDefaultFactory().releasePageContext(pageContext);
      private static final char __oracle_jsp_text[][]=new char[1][];
      static {
        try {
        __oracle_jsp_text[0] =
        "\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n    <title>untitled</title>\n  </head>\n  <body>\n  </body>\n</html>\n".toCharArray();
        catch (Throwable th) {
          System.err.println(th);
    }as you can see.. my IDE converts it into a java class so it can be conpiled to a class file.. by the way i use Oracle Jdeveloper 10g for this pupose of showing you what is happening to your jsp

  • How to run servlets under Tomcat 6 in java1.5

    hi all
    i am unable to run servlets under tomcat 6,i checked environment variables ....all are correct..im getting http 503 error....

    A 503 response says
    503 Service Unavailable
    The server is currently unable to handle the request due to a
    temporary overloading or maintenance of the server
    You apparently have the server mis-configured. Recheck the configuration (or reinstall Tomcat per its instructions.)

  • Problem in executing servlets under tomcat 4.1

    Dear Group,
    I am using Tomcat 4.1 and have the following directory structure:
    1.     C:\Tomcat 4.1\webapps\testapp
    ----It is my root directory and I have my html file called
    sample.html
    2.     C:\Tomcat 4.1\webapps\testapp\WEB-INF------web.xml is here
    3.     C:\Tomcat 4.1\webapps\testapp\classes\TestServlet.class
    -------here I have the servlet, no package---only one servlet
    My[b] web.xml has entry for:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
        <servlet>
            <servlet-name>TestServlet</servlet-name>
            <servlet-class>TestServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>TestServlet</servlet-name>
            <url-pattern>/TestServlet</url-pattern>
        </servlet-mapping>
    </web-app>My[b] sample.html contains:
    <HTML>
    <BODY>
    <form method="post" action="http://localhost:8080/testapp/TestServlet">
    <input type=submit value="showServlet">
    <h2>
    <font color="green">First try on Serlvet</font>
    </h2>
    </form>
    </BODY>
    </HTML>Here is what I have done:
    1.     Started the Tomcat server
    2.     In the IE browser, I typed http://localhost:8080/testapp/sample.html
    -------- - the file shown correctly and I clicked the showServlet button.
    3.     I got the follow error �HTTP Status 404 - /testapp/TestServlet" the
    requested resource not availble
    4.     when I clicked the showServelt button the control goes to another page
    (as it should go to execute the servlet) .
    The URL is �http://localhost:8080/testapp/TestServlet�
    Please enlighten me where I went wrong?

    Hello all,
    Thank you for answering the question now the servlet gets executed.
    I here posts the steps i carried out to execute the
    servlet. If anyone have different idea pls post. Im
    pasting here the steps also attaching one.
    Steps to create your directory and work in Tomcat 4.1
    1.     Create your directory in Tomcat�s webapps Directory.
    -----If your tomcat is in d:\ the your directory may look
    ----- D:\tomcat\webapps\<your directory>
         ------E.g. �d:\tomcat\webapps\test�
    2.     In the test directory you can your html files directly or you can create a
    directory to hold html files.
         --------E.g. �d:\tomcat\webapps\test\first.html (OR)
    -------E.g. �d:\tomcat\webapps\test\html-files\first.html�
    3.     Create a folder called WEB-INF inside test
    -------E.g. �d:\tomcat\webapps\test\WEB-INF
    ------ Under the WEB-INF folder put your web.xml file
    4.     Create another folder named classes under the same test
    ----- E.g. �d:\tomcat\webapps\test\classes
    ----- Here you need to place your servlet classes
    ----- E.g. �d:\tomcat\webapps\test\classes\testServlet.class
    5.     Start any browser that are java enabled
    6.     Type �http://<machine name (or) IP add.>:8080/<your folder
    name>/<html file>�
    ----     E.g. http://localhost:8080/test/ html-files/first.html
    -----E.g.http://127.0.0.1:8080/test/html-files/first.html
    7.     Click the component (button, label�) to enable servlet
    8.     That�s all! Now you should get your servlet executed.
    Files:
    1.     web.xml
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
    Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <servlet-name>testServlet</servlet-name>
        <servlet-class>testServlet</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>testServlet</servlet-name>
        <url-pattern>/testServlet/*</url-pattern>
      </servlet-mapping>
    </web-app>
    2. first.html
    <html>
    <body>
    <form method="POST"
    action="http://localhost:8080/test/testServlet">
    <input type=submit value=click></input>
    </form>
    </body>
    </html>
    3. testServlet.java
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class testServlet extends HttpServlet
         public void doPost(HttpServletRequest req,
    HttpServletResponse res)throws      ServletException,
    IOException
              PrintWriter out = res.getWriter();
              out.println("<html>");
              out.println("<body>");
              out.println("<h1>Hello! </h1>");
              out.println("</body>"+"</html>");
    }I have put my first.html inside the folder
    �d:\tomcat\webapps\test\html-files\� and testServlet
    is under �d:\tomcat\webapps\test\WEB-INF\classes\� folder.

  • How to run Servlet on Tomcat 4.0.1?

    OK. I've made a simple servlet and using Tomcat 4.0.1 on Windows ME. Tomcat's root directory is C:\jakarta-tomcat-4.0.1\webapps\ROOT. I copied folder with my servlet (java's class) in tomcat's root folder. When I try to run the dialog 'File Download' is showen. Why?
    Thanks.

    I have Tomcat 4.0. I am trying to run servlet but I could not manage it. I have put my class file in webapp/root/web-inif/classes/ I can not run my servlet... how can I manage this... what should I do more?
    the errors are :
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Cannot allocate servlet instance for path /servlet/Servlet1
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:419)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    root cause
    java.lang.NoClassDefFoundError: Servlet1 (wrong name: servlet/Servlet1)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1643)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:937)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1372)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1254)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:867)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:400)
         at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)

  • How to execute servlets

    help me in servlets execution.what i need to execute servlets

    Hi,
    A Servlet is "managed" by a Servlet Container - a Servlet Container is strictly not the only place where a Servlet can execute. You can even run a Servlet from your standalone JVM using your favourite java <className>.
    A Servlet Container, along with a HTTP Server / Java Listener, provides a HTTP interface to the outside world.
    I just wanted to point this difference in philosophy since you seem to be new to the world of Servlets.
    Anyways, since you seem to be learning Servlets, you need not be bothered about the finer philosophies & simply make use of the conveience of a Servlet Container. You would defenitely deploy to a Servlet Container ( or, a bigge J2EE Container ) in the real world.
    As suggested earlier in the Thread, simply download & install TomCat, dump your Servlet file in one of the standard folders & start your journey !!
    Regards,
    Sandeep

Maybe you are looking for

  • Programming generic sync with the MDK in 6.20

    Has anyone been able to get the generic sync examples provided with the MDK working - GenericSyncExample.java in particular? I imported and compiled the example without a problem but when I run it I get teh foll dump. Unfortunately the source code is

  • Like for Like Restriction in BW Query

    Hi, We are trying to develop one store sales dashboard with information LFL(like for like) sales last year sales, LFL this year sales,  LFL growth percentage. This report contain column for Daily,WTD, MTD and YTD so total (12 (4x3)fileds). Definition

  • Indesign CS3 what script for Break Out Text Frame ??

    hi expert, Indesign CS3 can Break Out Text Frame or Have Script ?? like this... http://img402.imageshack.us/img402/905/20080517085017hb3.jpg thank for tell

  • Coding user exit

    Hi, I have a situation where I need to suppress three material numbers in my query. When I try to do that it wouldn't let me do that because I have 140,000 material numbers and the maxumum can be displayed are 500 values only. Can someone suggest me

  • Wifi on my iPhone 5 just stopped working. It worked fine earlier. What can i do?

    Wifi on my iPhone 5 just stopped working. It worked fine earlier. What can i do?