Need help with web.xml and .war file

Discussions

Web tier: servlets, JSP, Web frameworks: Need help with web.xml and .war file

  1. Need help with web.xml and .war file (1 messages)

    Dear java guru's

    Need help with web.xml and .war file.

    I am using tomcat 3.2. I made change in my server.xml in conf directory of tomcat by adding

    following lines.
    <Context path="/assess"
    docBase="assess"
    crossContext="false"
    debug="0"
    reloadable="true"
    trusted="false" >
    </Context>

    So now my context name is "assess".In this contest I created a package name "login".The structure of

    it is like this
    assess -->
    login-->
    *.jsp
    Web-inf -->
    web.xml
    classes-->
    login--->
    *.class

    The web.xml is the default xml I copied from tomcat conf directory and put it in web-inf

    And some it is like this
    <load-on-startup> -2147483646 </load-on-startup> </servlet> <servlet-mapping>

    <servlet-name> invoker </servlet-name> <url-pattern> /servlet/*

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

    </servlet-name> <url-pattern> *.jsp </url-pattern> </servlet-mapping>

    <session-config> <session-timeout> 30 </session-timeout> </session-config>

    Now for making .war file I run the following command.
    from my contest assess> jar -cvf login.war *

    then I delete all file from my context except login.war
    Now when I run the following url http://localhost:8080/assess/login/index.jsp

    I am getting this error
    Error: 500
    Location: /assess/login/index.jsp
    Internal Servlet Error:

    javax.servlet.ServletException: login/Retry
    at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
    at org.apache.tomcat.core.Handler.service(Handler.java:286)
    at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)


    Root cause:
    java.lang.NoClassDefFoundError: login/Retry
    at

    login._0002flogin_0002findex_0002ejspindex_jsp_0._jspService(_0002flogin_0002findex_0002ejs

    pindex_jsp_0.java:64)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
    at org.apache.jasper.servlet.JspServlet.service(Compiled Code)

    login.Retry is first bean used in index.jsp

    Now Help me where I am lagging

    thanks in advance
    jaideep
  2. Need help with web.xml and .war file[ Go to top ]

    Try putting login directory under web-inf/classes. That should work. context name is path name to doc-root.