Problem in executing servlets on tomcat 5.5

Discussion in 'Java' started by ruds, Mar 26, 2008.

  1. ruds

    ruds Guest

    Hi,
    I'm developing a web application using tomcat 5.5.
    I can execute Jsp pages in my application, but when I try to execute
    servlets I simply cant execute them
    the error shown is: Requested resource is not available.
    Also my application's index page does on appear after i put entry of
    servlet in the web.xml file.
    But if I remove the entry in web.xml, my application runs perfect.
    the servlet gets executed in the webapps/ROOT directiry, but not in my
    dir.
    I have checked all the paths and classpaths again, still no
    difference.
    Can someone tell me where I could be going wrong?
     
    ruds, Mar 26, 2008
    #1
    1. Advertising

  2. ruds

    ruds Guest

    when I start the application from tomcat manager it does not start...
    and gives context error
    If I remove the servlet entry from web.xml my application runs
    properly..
    my web.xml is;
    <?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>HelloServlet</servlet-name>
    <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>Hello</url-pattern>
    </servlet-mapping> -->
    </web-app>

    Why is this happening?


    On Mar 26, 11:33 am, ruds <> wrote:
    > Hi,
    > I'm developing a web application using tomcat 5.5.
    > I can execute Jsp pages in my application, but when I try to execute
    > servlets I simply cant execute them
    > the error shown is: Requested resource is not available.
    > Also my application's index page does on appear after i put entry of
    > servlet in the web.xml file.
    > But if I remove the entry in web.xml, my application runs perfect.
    > the servlet gets executed in the webapps/ROOT directiry, but not in my
    > dir.
    > I have checked all the paths and classpaths again, still no
    > difference.
    > Can someone tell me where I could be going wrong?
     
    ruds, Mar 26, 2008
    #2
    1. Advertising

  3. ruds

    ruds Guest

    Sorry stupid mistake of mine.... :)
     
    ruds, Mar 26, 2008
    #3
  4. ruds wrote:
    > Sorry stupid mistake of mine.... :)


    Please share the solution in case I make the same silly mistake.
    Thanks.

    --
    RGB
     
    RedGrittyBrick, Mar 26, 2008
    #4
  5. ruds

    Lew Guest

    ruds wrote:
    > when I start the application from tomcat manager it does not start...
    > and gives context error
    > If I remove the servlet entry from web.xml my application runs
    > properly..
    > my web.xml is;
    > <?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>HelloServlet</servlet-name>
    > <servlet-class>HelloServlet</servlet-class>
    > </servlet>


    Never deploy Java code that is in the default (anonymous) package.

    --
    Lew
     
    Lew, Mar 26, 2008
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim
    Replies:
    4
    Views:
    7,002
  2. Jim
    Replies:
    2
    Views:
    872
  3. M
    Replies:
    5
    Views:
    435
    Christophe Vanfleteren
    Sep 20, 2003
  4. Arun Goel

    Servlets & Tomcat problems.

    Arun Goel, Oct 1, 2003, in forum: Java
    Replies:
    2
    Views:
    522
    William Brogden
    Oct 1, 2003
  5. Phil Jarvis
    Replies:
    2
    Views:
    807
    Sudsy
    Jul 7, 2004
Loading...

Share This Page