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

    java.lang.NoClassDefFoundError: javax/servlet/ServletRequest

    jamest

      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

        • 1. Re: java.lang.NoClassDefFoundError: javax/servlet/ServletReq
          jamest

          Ok, I solved this by including the servlet.jar from the catalina directories in the JBOSS_CLASSPATH, but I still don't understand

          1. Why the jsp could find the class, but the classes it was calling could not.

          2. Why including servlet.jar in the jboss/lib/ext or WEB-INF/lib did not work

          Any comments would be great

          Cheers

          James