1 Reply Latest reply on Jan 7, 2002 6:57 AM by james

    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

    james Newbie

      I get the above runtime error when calling my index jsp, here is the start of the stack trace of the root cause :

      [10:16:50,888,EmbeddedCatalinaServiceSX] ----- Root Cause -----
      java.lang.NoClassDefFoundError: javax/servlet/ServletRequest
      at org.apache.jsp.index$jsp._jspService(index$jsp.java:1048)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)

      (there is more to this stack trace),

      What I find strange here is that the implication is that the classpath does not have javax.servlet.http.ServletRequest in it. However further up the stack trace is javax.servlet.http.HttpServlet, which is in the same package

      This is the bit of code where it falls over

      session = request.getSession(true);
      com.cgu.hamburg.generic.JSPPageInfo pageInfo = new com.cgu.hamburg.generic.JSPPageInfo(pageContext, request, response, session);

      Again what is strange is that it doesn't fall over in the first use of request (request.getSession(true); ) , but falls over when instanciating JSPPageInfo.

      the declaration of this method in JSPPageInfo is
      :

      public JSPPageInfo(PageContext aPageContext, HttpServletRequest aRequest, HttpServletResponse aResponse, HttpSession aSession)
      {



      This class includes javax.servlet.http.*,

      The jsp worked fine under weblogic so I don't think there's a problem with the code.

      I guess I need to stick the servlet.jar into somewhere but I don't really understand why, I've tried putting it into WEB-INF/lib, but this didn't work.

      Any help greatly appreciated

      Cheers

      James Thornley