I'm having trouble compiling a JSP/Java servlet that compiled without
error under Apache1.3.27-4/Tomcat 4.1.18 running on Linux
I'm configuring a new server and have upgraded to Apache 2.2.0/Tomcat
5.5.15, Fedora Core 4 (x86_64 machine).
When the engine attempts to compile my .JSP source file, I now encounter
the following error message(s):
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
The method handlePageException(Exception) in the type PageContext is not
applicable for the arguments (Throwable)
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
The method handlePageException(Exception) in the type PageContext is not
applicable for the arguments (Throwable)
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
note The full stack trace of the root cause is available in the Apache
Tomcat/5.5.15 logs.
-------------------------------------------------------------------------------------------------------------------------------------------------------
When I attempt to directly compile the work directory java file output
from the ,jsp file, the following errors occur:
/opt/tomcat/work/Catalina/localhost/NetAsker/org/apache/jsp/Question_jsp.java:27:
org.apache.jsp.Question_jsp is not abstract and does not
override abstract method getDependants() in
org.apache.jasper.runtime.JspSourceDependent
public final class Question_jsp extends
org.apache.jasper.runtime.HttpJspBase
^
/opt/tomcat/work/Catalina/localhost/NetAsker/org/apache/jsp/Question_jsp.java:2576:
getDependants() in org.apache.jsp.Question_jsp cannot implement
getDependants() in org.apache.jasper.runtime.JspSourceDependent;
attempting to use incompatible return type
found : java.lang.Object
required: java.util.List
public Object getDependants() {
^
/opt/tomcat/work/Catalina/localhost/NetAsker/org/apache/jsp/Question_jsp.java:3799:
handlePageException(java.lang.Exception) in
javax.servlet.jsp.PageContext cannot be applied to
(java.lang.Throwable)
if (_jspx_page_context != null)
_jspx_page_context.handlePageException(t);
^
---------------------------------------------------------------------------------------------
I can hand edit the file Question_jsp.java and eliminate these error by
making the following changes:
original:
private static java.util.List _jspx_dependants;
public Object getDependants() {
return _jspx_dependants;
}
Changed to:
private static java.util.List _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
--------------------------------------------------------------------
original:
catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null)
_jspx_page_context.handlePageException(t);
}
changed to:
catch (Exception t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null)
_jspx_page_context.handlePageException(t);
}
=====================================================================
But, since I cannot figure out how to determine which lines in my .JSP
source file generated
this source code, I have not been able to make changes that would allow
this servlet to work.
I've read of similar problems being caused by out of sync versions of
servlet.jar files, but I've tried both the older version (servlet.jar
filesize: 80054) and the newer one (servlet.jar filesize: 35904), and
neither corrects the compilation errors.
If this is a common problem, and there is a common solution, I'd love to
know what it is. I can rewrite the entire source file if needed, but the
same source file has been working without problems for 2 years and I
would like to avoid the rewrite if at all possible.
Please let me know if you have any ideas of the changes I need to make
to correct these errors.
Thanks for any knowledge you can share with me,
Regards,
--
Steve Downie
M A I N T E N A N C E M O D E, I N C.
Software Consulting Services
Voice: (408) 777-0300 Fax: (408) 777-0301
Web: http://www.maintenancemode.com
Email: sdownie at maintenancemode dot com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]