tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felix <fe...@crucial-systems.com>
Subject Re: Problem with tracking Errors: Suspectious Try with missing ca tch... (ErrorLog and Source included)
Date Tue, 09 Oct 2001 20:45:17 GMT

And, if I'm not mistaken, sometimes a 'catch without try' comes up when
you don't have any catch/try surrounding the code in question.
The try/catch block is put in place by the jsp->servlet transformation.

the problem is still that we have a misplaced brace somewhere.



on 10/8/01 6:35 AM, Paul Foxton at paul@network-sol.com wrote:

> a couple of things:
> 
> I think you're problem is that you havn't closed the brackets for your try
> block - try adding one more close bracket before your catch, this should
> sort out your problem.
> 
> The reason you can't find the error in the line specified in the stacktrace
> is that you are checking the original .jsp file, the stacktrace is giving
> you the error line number for the servlet compiled from the jsp source.
> 
> Look in your tomcat/work directory under the directory your webapp is in,
> look for the file called _0002fjsp_0002fadmin_0002fsqlquery_jsp.java
> 
> This will show you the compiled code, the line number for the error refers
> to this file, not your .jsp
> 
> hope this helps,
> 
> Paul
> 
>> -----Original Message-----
>> From: Sebastian Hagenbrock [mailto:sebastian.hagenbrock@eventim.de]
>> Sent: 08 October 2001 11:22
>> To: Tomcat Maillist
>> Subject: Problem with tracking Errors: Suspectious Try with missing
>> catch... (ErrorLog and Source included)
>> 
>> 
>> Hi,
>> 
>> please help me with the fallowing problem.
>> 
>> 1.) Server:
>> I use a SuseLinux 7.2 Pro Server running Apache and Tomcat4 (JDK 1.3).
>> 
>> 2.) Error Tracing:
>> First problem I have, is that it is really difficult to find
>> out, in wich
>> lines the error is. Why? The linenumbers didn't match the
>> linenumbers in the
>> source. I've inserted 2 Returns after a line, checked if the
>> number changes.
>> If not, it must be before that line, else I test another
>> location. This is
>> very frustrating, because some pages have more then 500 lines.
>> 
>> This is why I didn't find any suggestion for the fallowing error:
>> 
>> 3.) What I've already tried:
>> 
>> Below this posting there are two parts: One includes the
>> whole error msg.
>> The other one the Source Code.
>> 
>> Using the "InsertReturnMethod" i've described, i think that
>> the error occurs
>> in line 5 to 7 of the SourceCode. The joke is, that even when I'm
>> uncommenting this part, the error still occurs (even after restarting
>> Tomcat). Even if I uncomment the complete try catch block
>> beginning at line
>> 14 doesn't take any effect.
>> 
>> 4.) The JSP Error MSG:
>> _________________________
>> org.apache.jasper.JasperException: Unable to compile class for
>> JSPnull/usr/local/jakarta/work/localhost/_/jsp/admin/_0002fjsp
>> _0002fadmin_00
>> 02fsqlquery_jsp.java:228: 'catch' without 'try'.
>> } catch (Throwable t) {
>> ^
>> null/usr/local/jakarta/work/localhost/_/jsp/admin/_0002fjsp_00
>> 02fadmin_0002f
>> sqlquery_jsp.java:236: 'try' without 'catch' or 'finally'.
>> }
>> ^
>> null/usr/local/jakarta/work/localhost/_/jsp/admin/_0002fjsp_00
>> 02fadmin_0002f
>> sqlquery_jsp.java:236: '}' expected.
>> }
>> ^
>> 3 errors
>> 
>> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
>> at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:528)
>> at
>> org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfN
>> ecessary(JspSe
>> rvlet.java:176)
>> at
>> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
>> (JspServlet.ja
>> va:188)
>> at 
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
>> .java:381)
>> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:458)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
>> er(Application
>> FilterChain.java:247)
>> at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
>> cationFilterCh
>> ain.java:193)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
>> rapperValve.ja
>> va:243)
>> at
>> org.apache.catalina.core.StandardPipeline.invokeNext(StandardP
>> ipeline.java:5
>> 66)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
>> ine.java:472)
>> at 
>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardC
>> ontextValve.ja
>> va:215)
>> at
>> org.apache.catalina.core.StandardPipeline.invokeNext(StandardP
>> ipeline.java:5
>> 66)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
>> ine.java:472)
>> at 
>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>> at
>> org.apache.catalina.core.StandardContext.invoke(StandardContex
>> t.java:2314)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
>> Valve.java:164
>> )
>> at
>> org.apache.catalina.core.StandardPipeline.invokeNext(StandardP
>> ipeline.java:5
>> 66)
>> at 
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValv
>> e.java:462)
>> at
>> org.apache.catalina.core.StandardPipeline.invokeNext(StandardP
>> ipeline.java:5
>> 64)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
>> ine.java:472)
>> at 
>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>> at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
>> gineValve.java
>> :163)
>> at
>> org.apache.catalina.core.StandardPipeline.invokeNext(StandardP
>> ipeline.java:5
>> 66)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
>> ine.java:472)
>> at 
>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>> at
>> org.apache.catalina.connector.http.HttpProcessor.process(HttpP
>> rocessor.java:
>> 1000)
>> at
>> org.apache.catalina.connector.http.HttpProcessor.run(HttpProce
>> ssor.java:1093
>> )
>> at java.lang.Thread.run(Thread.java:484)
>> ____________________
>> 
>> 5.) The Source:
>> ____________________
>> 
>> 1: <%@page session="true" %>
>> 2: <%  HttpSession sitzung = request.getSession(false);
>> 3:    java.sql.ResultSet res = null;
>> 4: String isValidSession =
>> (String)sitzung.getAttribute("isValidSession");
>> 5: if(!(isValidSession == "true")){
>> 6:   
>> response.sendRedirect(response.encodeURL("../main/login.jsp"));
>> 7: } /*if(!(sitzung.getAttribute("isValid.... */
>> 8:
>> 9:
>> 10: intra.users.user usr =
>> (intra.users.user)sitzung.getAttribute("usr");
>> 11: if(!usr.isAdmin()) {
>> 12:  
>> response.sendRedirect(response.encodeURL("../main/login.jsp"));
>> 13: }else{ /*if(!usr.isAdmin()) */
>> 14:  try {  /*Did not make any different if this is
>> commentet! The Error
>> still
>> 15:    occours!*/
>> 16:   intra.util.SQLVerbindung sql = new
>> intra.util.SQLVerbindung();
>> 17:   if(request.getParameter("mode") == "query") {
>> 18:    res = sql.intraQuery(query);
>> 19:   }else {
>> 20:    succexec = sql.intraExecute(query);
>> 21:   } /*if(request.getParameter("mode") ==
>> "query") */
>> 22:  }catch(java.sql.SQLException sqle){
>> 23:   errmsg = sqle.getMessage();
>> 24:   err = true;
>> 25:  }catch(Exception e){
>> 26:   errmsg = errmsg + e.getMessage();
>> 27:   err = true;
>> 28:  } /*catch*/
>> 29:  %>
>> ..
>> ..
>> 136:       <%}%>
>> ____________________
>> 
>> Did you know any suggestions, how to solve that??
>> Or even a small trick to trace errors more efficent?
>> 
>> 
>> YS
>> 
>> Sebastian Hagenbrock
>> 
>> PS. Sorry for my bad grammar and spelling.
>> 
> 
> 


Mime
View raw message