The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Tomcat unable to find servlet

Discussion in 'General Discussion' started by sumitlole, May 23, 2011.

?

Which Server is best fit for Java based Web Application

  1. Linux Based Shared server

    0 vote(s)
    0.0%
  2. Windows based Shared server

    0 vote(s)
    0.0%
  1. sumitlole

    sumitlole Registered

    Joined:
    May 23, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    I have a problem trying to set up tomcat to run a simple servlet and hope someone can help out.

    I am trying to deploy/upload a Java based web application on Linux based shared Java hosting server. For this I have uploaded the war file on Cpanel, also I have created same file structure as it was in Tomcat.

    I have created following structure in public_html directory of Cpanel:

    -css
    -html
    -js
    -jsp
    -META-INF
    ----classes
    ----lib
    ----web.xml
    -WEB-INF
    -index.html
    -Model.war


    *All the classes are kept in classes folder inside web-inf.

    Tomcat is running and the index page is visible. I have redirected from index.html page to jlogin.jsp page inside the jsp folder. It working fine with complete effect of css & images and all scripting working fine on jlogin page.

    But when I am calling Login servlet from jlogin.jsp page it gives 404 NOT FOUND error. I have tried all possible path to call servlet, still problem persist.

    Login.class servlet is located in : WEB-INF/classes/com/org/Model/servlets


    ERROR is - 404
    type Status report
    message /Model/Login
    description The requested resource (/Model/Login) is not available.


    //web.xml follows (located in WEB-INF

    <?xml version="1.0" encoding="ISO-8859-1"?>

    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
    version="2.5">

    <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>com.org.model.servlets.Login</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/Login</url-pattern>
    </servlet-mapping>

    </web-app>

    Urgent help is required.
     
Loading...

Share This Page