1 Reply Latest reply on Oct 14, 2002 5:21 PM by Juha Lindfors

    tomcat4.1 jsp example error[pageContext != null]!

    swingcoder Newbie

      Environment:
      System:window 2000 advanced server;
      JAVA_HOME=c:\j2sdk1.4.1;
      J2EE_HOME=C:\j2sdkee1.3.1;
      ANT_HOME=c:\ant;
      TOMCAT_HOME=c:\Tomcat 41
      CATALINA_HOME=c:\Tomcat 41
      classpath=.;
      c:\j2sdk1.4.1\lib\tools.jar;
      c:\j2sdk1.4.1\jre\lib\rt.jar;
      c:\j2sdk1.4.1\jre\lib\jsse.jar;
      c:\j2sdkee1.3.1\lib\j2eetools.jar;
      c:\j2sdkee1.3.1\lib\ejb10deployment.jar;
      e:\javasrc;
      c:\j2sdk1.4.1\lib\fscontext.jar;
      c:\j2sdk1.4.1\lib\providerutil.jar;
      c:\j2sdkee1.3.1\lib\j2ee.jar


      Question:the example /examples/jsp/dates/date.jsp,occur the following errors.but most of the other examples are perfect.
      and i have checked the java source located at \work\Standalone\localhost\examples\jsp\dates,got the following lines:
      try{
      ...
      } catch (Throwable t) {
      out = _jspx_out;
      if (out != null && out.getBufferSize() != 0)
      out.clearBuffer();
      if (pageContext != null) pageContext.handlePageException(t);
      } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
      }

      Error output:
      type Exception report message
      description The server encountered an internal error () that prevented it from fulfilling this request.
      exception
      org.apache.jasper.JasperException: Unable to compile class for JSP
      An error occurred at line: -1 in the jsp file: null
      Generated servlet error:
      [javac] Compiling 1 source file

      C:\Tomcat 41\work\Standalone\localhost\examples\jsp\dates\date_jsp.java:101: handlePageException(java.lang.Exception) in javax.servlet.jsp.PageContext cannot be applied to (java.lang.Throwable)
      if (pageContext != null) pageContext.handlePageException(t);
      ^
      1 error

      Analyse:
      1.According as the Tomcat error messages:
      handlePageException(java.lang.Exception) in javax.servlet.jsp.PageContext cannot be applied to (java.lang.Throwable)
      it means that the java.lang.Throwable doesn't suit for javax.servlet.jsp.PageContext.handlePageException() method.

      2.and i have checked the two packages,one at TOMCAT_HOME/tomcat/common/lib/servlet.jar and another at J2EE_HOME/lib/j2ee.jar and the two packages are not the same size,what's the difference between them? dose it affect the class javax.servlet.jsp.PageContext ?

      3.Tomcat document says class or resource loading looks in the following repositories, in this order:
      /WEB-INF/classes of your web application
      /WEB-INF/lib/*.jar of your web application
      Bootstrap classes of your JVM
      System class loader classses (described above)
      $CATALINA_HOME/common/classes
      $CATALINA_HOME/common/endorsed/*.jar
      $CATALINA_HOME/common/lib/*.jar
      $CATALINA_HOME/shared/classes
      $CATALINA_HOME/shared/lib/*.jar

      when i use J2EE_HOME/lib/j2ee.jar instead of TOMCAT_HOME/tomcat/common/lib/servlet.jar ,Tomcat not started!

      4.Is it a software bug?


      Any Helps?!!



      Sincerely!