You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sebastian Hagenbrock <se...@eventim.de> on 2001/10/08 12:21:54 UTC
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_0002fadmin_0002f
sqlquery_jsp.java:236: 'try' without 'catch' or 'finally'.
}
^
null/usr/local/jakarta/work/localhost/_/jsp/admin/_0002fjsp_0002fadmin_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.loadIfNecessary(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.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
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.ja
va:215)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
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:2314)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
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
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
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:
1000)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.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.