tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rickard <David.Rick...@techbooks.com>
Subject Sending Again: Tomcat Will Not Compile JSPs
Date Tue, 18 Oct 2005 21:25:56 GMT
System: Solaris SunOS 5.9
Apache: 2.0.52
Tomcat: 4.1.29
Mod JK: 1.2.6
JDK: 1.4.2_02

We have used the above Apache-Tomcat installation for 1-2 years.  Within 
the last few days, Tomcat has started failing to compile JSPs.
When either a new (previously unvied) or modified JSP is requested, Tomcat 
throws the following error message:

         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

Tomcat is otherwise behaving normally: unmodified pages load and behave 
normally.

There are repetitive ClassNotFoundException messages in catalina.out for 
various jasper and naming classes (org.apache.jasper.runtime.HttpJspBase, 
org.apache.jasper.runtime.TagHandlerPool, 
org.apache.jasper.servlet.JspServlet, 
org.apache.naming.java.javaURLContextFactory, ).

The Jasper jars (jasper-runtime.jar, jasper-compiler.jar) are listed in 
catalina.out as "repositories," but not as "available" extensions under the 
StandardClassLoader.

We have replaced the contents of common/lib from a fresh download (same 
Tomcat version), without result.

Tomcat/Jasper is able to write the java file for a new/modified JSP under 
work/Standalone/myserver/myapp/, but does not write the class file;
i.e., putting My_JSP.jsp:
<html>
<head><title>Test Page</title></head>
<body><p><h1>Generic Content: My JSP</h1></p></body>
</html>

under myapp & requesting the page generates My_JSP_jsp.java:

package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;

public class My_JSP_jsp extends HttpJspBase {


   private static java.util.Vector _jspx_includes;

   public java.util.List getIncludes() {
     return _jspx_includes;
   }

   public void _jspService(HttpServletRequest request, HttpServletResponse 
response)
         throws java.io.IOException, ServletException {

     JspFactory _jspxFactory = null;
     javax.servlet.jsp.PageContext pageContext = null;
     HttpSession session = null;
     ServletContext application = null;
     ServletConfig config = null;
     JspWriter out = null;
     Object page = this;
     JspWriter _jspx_out = null;


     try {
       _jspxFactory = JspFactory.getDefaultFactory();
       response.setContentType("text/html;charset=ISO-8859-1");
       pageContext = _jspxFactory.getPageContext(this, request, response,
                         null, true, 8192, true);
       application = pageContext.getServletContext();
       config = pageContext.getServletConfig();
       session = pageContext.getSession();
       out = pageContext.getOut();
       _jspx_out = out;

       out.write("<html>\n");
       out.write("<head>");
       out.write("<title>Test Page");
       out.write("</title>");
       out.write("</head>\n");
       out.write("<body>");
       out.write("<p>");
       out.write("<h1>Generic Content: My JSP");
       out.write("</h1>");
       out.write("</p>");
       out.write("</body>\n");
       out.write("</html>\n");
     } 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);
     }
   }
}

but not My_JSP_jsp.class.  Tomcat's ability to write the java file under 
/work would seem to rule out permissions issues with that directory.

Also, we can compile and run stand-alone Java classes using the 1.4.2_02 JDK.

The net condition is: Tomcat is running, and can serve compiled JSPs and 
servlets without errors; Tomcat cannot compile new/modified JSPs; and 
Tomcat/Jasper seem to be losing file names between generating *_jsp.java 
and *_jsp.class (note the "jsp file: null" in the error message).

Any ideas?


--

David Rickard
Software Engineer

TechBooks/GTS
Your Single Source Solution!
Los Angeles CA * York, PA * Boston,MA * New Delhi, India
Visit us on the World Wide Web 
<http://www.techbooks.com>http://www.techbooks.com

david.rickard@techbooks.com
5650 Jillson St., Los Angeles, CA 90040
(323) 888-8889 x331
(323) 888-1849 (Fax)


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message