Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with TOMCAT 4  RSS feed

 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat is giving me problems compiling .jsp and servlets. I have to compile my servlet myself and then put into the directory and it works. However, could you compile .jsp by myself and then I will put in into the directory. I'm very frustated with Tomcat especially with compiling .jsp. I want to do it myself and put it after. Could anyone show me how to compile a .jsp. The error that I get with Tomcat is the following. If you can tell me what's wrong I would really apprecited. Thanks in advance.
error:
Incompatible type for method. Explicit cast needed to convert java.lang.Throwable to java.lang.Exception.
C:\Program Files\Apache Tomcat 4.0\work\localhost\examples\jsp\checkbox\checkresult$jsp.java:158: Incompatible type for method. Explicit cast needed to convert java.lang.Throwable to java.lang.Exception.
if (pageContext != null) pageContext.handlePageException(t);
^
1 error
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)
[ February 21, 2002: Message edited by: bobby, morkos ]
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use FORTE to generate the servlet out of the jsp and compile.
however why u need to convert jsp to a servlet??
why not then better write servlet instead??
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already have coded in .jsp. But, I will start making servlet from now on. I have to many problems with .jsp. Thanks for the fast reply. I want to use ant in order to compile .jsp into .class. Do you know how? Thanks again.
What jars do I require in order to compile my .jsp into servlets.
Originally posted by prabhat kumat:
use FORTE to generate the servlet out of the jsp and compile.
however why u need to convert jsp to a servlet??
why not then better write servlet instead??

[ February 21, 2002: Message edited by: bobby, morkos ]
 
Jim Otte
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me the error is not with jsp's but exactly what the stack trace says:
Explicit cast needed to convert java.lang.Throwable to java.lang.Exception.
if (pageContext != null) pageContext.handlePageException(t);
^
1 error
You are passing Throwable t into handlePageException() when it requires class Exception (You must cast down)- just change it to
if (pageContext != null) pageContext.handlePageException((Exception)t);
and all should be well
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where is this error being generated so I can change it. Thanks a lot for your help.

Originally posted by Jim Otte:
It seems to me the error is not with jsp's but exactly what the stack trace says:
Explicit cast needed to convert java.lang.Throwable to java.lang.Exception.
if (pageContext != null) pageContext.handlePageException(t);
^
1 error
You are passing Throwable t into handlePageException() when it requires class Exception (You must cast down)- just change it to
if (pageContext != null) pageContext.handlePageException((Exception)t);
and all should be well
 
Jim Otte
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the stack trace you wrote-
C:\Program Files\Apache Tomcat 4.0\work\localhost\examples\jsp\checkbox\checkresult$jsp.java:158: Incompatible type for method. Explicit cast needed to convert java.lang.Throwable to java.lang.Exception.
if (pageContext != null) pageContext.handlePageException(t);
^
1 error
it seems like it is in your class checkbox\checkresult.jsp - line 158 - look in your jsp- you prob. have a line just like that - passing in Throwable instead of Exception...That's how the error was generated...
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what does the JSP look like? It would help to track down this problem.
 
bobby, morkos
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I re-installed Tomcat and on my first jsp page that I made I used the code after the .jsp
http://host ort/someWebApp/somePage.jsp?jsp_precompile=true

Originally posted by Carl Trusiak:
Well, what does the JSP look like? It would help to track down this problem.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nice url boby but, What is the code for the JSP page?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!