Re: Error 500 messages
Yes, for example: <%@ page buffer='128kb' %> -Tim Adile Abbadi wrote: Hi Tim, Thanx for this again - sorry to be a pain - but this is good info - so the bugger size value is a jsp page directive? I'll check into it - but if you can confirm I would appreciate it. Thanx Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 24, 2005 7:46 AM To: Tomcat Users List Subject: Re: Error 500 messages The response is being comitted before the erro is being thrown. You need to set the buffer size to be larger. Its a page directive. -Tim Adile Abbadi wrote: Hi Tim, Thank you very much - that has helped - however I discovered that the problem still exists if I have an include within an include - ie. I have an include called this Inside that include I have another include also with flush set to false - and I still get a blank page - however if I remove the includes within the include then the exception is visible. Any ideas on this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error 500 messages
Hi Tim, Thanx for this again - sorry to be a pain - but this is good info - so the bugger size value is a jsp page directive? I'll check into it - but if you can confirm I would appreciate it. Thanx Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 24, 2005 7:46 AM To: Tomcat Users List Subject: Re: Error 500 messages The response is being comitted before the erro is being thrown. You need to set the buffer size to be larger. Its a page directive. -Tim Adile Abbadi wrote: > Hi Tim, > > Thank you very much - that has helped - however I discovered that the > problem still exists if I have an include within an include - ie. > > I have an include called this > > > > Inside that include I have another include also with flush set to false - > and I still get a blank page - however if I remove the includes within the > include then the exception is visible. Any ideas on this? > > Cheers > > Adile > > > -Original Message- > From: Tim Funk [mailto:[EMAIL PROTECTED] > Sent: July 22, 2005 12:42 PM > To: Tomcat Users List > Subject: Re: Error 500 messages > > > flush="false" > > -Tim > > Adile Abbadi wrote: > > >>Hi Tim, >> >>Thanx for the information - I forgot about that. I guess the question is > > why > >>did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround > > to > >>get it to work? >> >>Adile >> >> >>-Original Message- >>From: Tim Funk [mailto:[EMAIL PROTECTED] >>Sent: July 22, 2005 12:20 PM >>To: Tomcat Users List >>Subject: Re: Error 500 messages >> >> >>This line will commit the >>response >>and send html back to the client. Once that is done - no error messages > > will > >>be sent back to the client and you will end up with a blank screen. >> >>-Tim >> >>Adile Abbadi wrote: >> >> >> >>>Hi Rob, >>> >>>Thanx for this - this is great - I may have to use this because I think I >>>have truly found a bug in Tomcat as this issue is not happening on my >> >>Tomcat >> >> >>>3 server. I did a bit more investigation and I found some interesting >>>things. This is going to be a long email with code and stuff but whoever >>>wants to read it please do - because the results are weird. >>> >>>I created the following simple JSP page >>> >>><%@ page language="java" >>>import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> >>><%^M >>> String query = "select * from patient_info where ref_client = 38 >> >>and >> >> >>>pat_lname like '%SM'ITH%';"; >>> DBConnectionManager connMgr; >>> connMgr = DBConnectionManager.getInstance(); >>> Connection Conn = connMgr.getConnection("podb"); >>> Statement SQLS = Conn.createStatement(); >>> ResultSet rs = SQLS.executeQuery(query); >>> String col1 = null; >>> String col2 = null; >>> while(rs.next()) { >>> col1 = rs.getString("pat_id"); >>> col2 = rs.getString("pat_fname"); >>>%> >>><%=col1%>: <%=col2%> >>> >>><% >>> } >>> rs.close(); >>> SQLS.close(); >>> connMgr.freeConnection("podb",Conn); >>>%> >>> >>>As you can see I did a syntax error in the query and the error comes to >> >>the >> >> >>>screen as expected >>> >>>javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at >>>character 74 >>> >>>I said that's weird so I tried to compare my complicated JSP files to what >> >>I >> >> >>>have here to see what is different (if I did something wrong) and I found >>>this >>> >>>If I add an include at certain parts of the page - I see the result I was >>>talking about. For example if I do this: >>> >>> >>><%@ page language="java" >>>import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> >>><%^M >>> String query = "select * from patient_info where ref_client = 38 >> >>and >> >> >>>pat_lname like '%SM'ITH%';"; >>> DBConnectionManager connMgr; >>>
Re: Error 500 messages
The response is being comitted before the erro is being thrown. You need to set the buffer size to be larger. Its a page directive. -Tim Adile Abbadi wrote: Hi Tim, Thank you very much - that has helped - however I discovered that the problem still exists if I have an include within an include - ie. I have an include called this Inside that include I have another include also with flush set to false - and I still get a blank page - however if I remove the includes within the include then the exception is visible. Any ideas on this? Cheers Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 22, 2005 12:42 PM To: Tomcat Users List Subject: Re: Error 500 messages flush="false" -Tim Adile Abbadi wrote: Hi Tim, Thanx for the information - I forgot about that. I guess the question is why did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround to get it to work? Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 22, 2005 12:20 PM To: Tomcat Users List Subject: Re: Error 500 messages This line will commit the response and send html back to the client. Once that is done - no error messages will be sent back to the client and you will end up with a blank screen. -Tim Adile Abbadi wrote: Hi Rob, Thanx for this - this is great - I may have to use this because I think I have truly found a bug in Tomcat as this issue is not happening on my Tomcat 3 server. I did a bit more investigation and I found some interesting things. This is going to be a long email with code and stuff but whoever wants to read it please do - because the results are weird. I created the following simple JSP page <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> As you can see I did a syntax error in the query and the error comes to the screen as expected javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at character 74 I said that's weird so I tried to compare my complicated JSP files to what I have here to see what is different (if I did something wrong) and I found this If I add an include at certain parts of the page - I see the result I was talking about. For example if I do this: <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> I get the error page as I should - however If I move the include to below the <%@ page language="java" - I get a blank page!! Now here is where it gets weirder - if I force a java syntax error like as follows (I corrected the query): <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SMITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; if (col1.equals("yes") { //test } while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> &l
RE: Error 500 messages
Hi Tim, Thank you very much - that has helped - however I discovered that the problem still exists if I have an include within an include - ie. I have an include called this Inside that include I have another include also with flush set to false - and I still get a blank page - however if I remove the includes within the include then the exception is visible. Any ideas on this? Cheers Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 22, 2005 12:42 PM To: Tomcat Users List Subject: Re: Error 500 messages flush="false" -Tim Adile Abbadi wrote: > Hi Tim, > > Thanx for the information - I forgot about that. I guess the question is why > did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround to > get it to work? > > Adile > > > -Original Message- > From: Tim Funk [mailto:[EMAIL PROTECTED] > Sent: July 22, 2005 12:20 PM > To: Tomcat Users List > Subject: Re: Error 500 messages > > > This line will commit the > response > and send html back to the client. Once that is done - no error messages will > be sent back to the client and you will end up with a blank screen. > > -Tim > > Adile Abbadi wrote: > > >>Hi Rob, >> >>Thanx for this - this is great - I may have to use this because I think I >>have truly found a bug in Tomcat as this issue is not happening on my > > Tomcat > >>3 server. I did a bit more investigation and I found some interesting >>things. This is going to be a long email with code and stuff but whoever >>wants to read it please do - because the results are weird. >> >>I created the following simple JSP page >> >><%@ page language="java" >>import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> >><%^M >>String query = "select * from patient_info where ref_client = 38 > > and > >>pat_lname like '%SM'ITH%';"; >>DBConnectionManager connMgr; >>connMgr = DBConnectionManager.getInstance(); >>Connection Conn = connMgr.getConnection("podb"); >>Statement SQLS = Conn.createStatement(); >>ResultSet rs = SQLS.executeQuery(query); >>String col1 = null; >>String col2 = null; >>while(rs.next()) { >>col1 = rs.getString("pat_id"); >>col2 = rs.getString("pat_fname"); >>%> >><%=col1%>: <%=col2%> >> >><% >>} >>rs.close(); >>SQLS.close(); >>connMgr.freeConnection("podb",Conn); >>%> >> >>As you can see I did a syntax error in the query and the error comes to > > the > >>screen as expected >> >>javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at >>character 74 >> >>I said that's weird so I tried to compare my complicated JSP files to what > > I > >>have here to see what is different (if I did something wrong) and I found >>this >> >>If I add an include at certain parts of the page - I see the result I was >>talking about. For example if I do this: >> >> >><%@ page language="java" >>import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> >><%^M >>String query = "select * from patient_info where ref_client = 38 > > and > >>pat_lname like '%SM'ITH%';"; >>DBConnectionManager connMgr; >>connMgr = DBConnectionManager.getInstance(); >>Connection Conn = connMgr.getConnection("podb"); >>Statement SQLS = Conn.createStatement(); >>ResultSet rs = SQLS.executeQuery(query); >>String col1 = null; >>String col2 = null; >>while(rs.next()) { >>col1 = rs.getString("pat_id"); >>col2 = rs.getString("pat_fname"); >>%> >><%=col1%>: <%=col2%> >> >><% >>} >>rs.close(); >>SQLS.close(); >>connMgr.freeConnection("podb",Conn); >>%> >> >>I get the error page as I should - however If I move the include to below >>the <%@ page language="java" - I get a blank page!! >> >>Now here is where it gets weirder - if I force a java syntax error like as >>follows (I corrected the query): >> >> >><%@ page language="java" >>import="javax.crypto.*,java.sql.*,java.net.*,db
Re: Error 500 messages
flush="false" -Tim Adile Abbadi wrote: Hi Tim, Thanx for the information - I forgot about that. I guess the question is why did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround to get it to work? Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 22, 2005 12:20 PM To: Tomcat Users List Subject: Re: Error 500 messages This line will commit the response and send html back to the client. Once that is done - no error messages will be sent back to the client and you will end up with a blank screen. -Tim Adile Abbadi wrote: Hi Rob, Thanx for this - this is great - I may have to use this because I think I have truly found a bug in Tomcat as this issue is not happening on my Tomcat 3 server. I did a bit more investigation and I found some interesting things. This is going to be a long email with code and stuff but whoever wants to read it please do - because the results are weird. I created the following simple JSP page <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> As you can see I did a syntax error in the query and the error comes to the screen as expected javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at character 74 I said that's weird so I tried to compare my complicated JSP files to what I have here to see what is different (if I did something wrong) and I found this If I add an include at certain parts of the page - I see the result I was talking about. For example if I do this: <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> I get the error page as I should - however If I move the include to below the <%@ page language="java" - I get a blank page!! Now here is where it gets weirder - if I force a java syntax error like as follows (I corrected the query): <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SMITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; if (col1.equals("yes") { //test } while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> An error will get thrown to the screen org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 2 in the jsp file: /testdb.jsp /var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')' expected if (col1.equals("yes") { However if I try to force a null pointer error by correcting my syntax error - I get a blank screen! If remove the include I get the null pointer error no problem. The other behaviour I noticed as well is that as I said bef
RE: Error 500 messages
Hi Tim, Thanx for the information - I forgot about that. I guess the question is why did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround to get it to work? Adile -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: July 22, 2005 12:20 PM To: Tomcat Users List Subject: Re: Error 500 messages This line will commit the response and send html back to the client. Once that is done - no error messages will be sent back to the client and you will end up with a blank screen. -Tim Adile Abbadi wrote: > Hi Rob, > > Thanx for this - this is great - I may have to use this because I think I > have truly found a bug in Tomcat as this issue is not happening on my Tomcat > 3 server. I did a bit more investigation and I found some interesting > things. This is going to be a long email with code and stuff but whoever > wants to read it please do - because the results are weird. > > I created the following simple JSP page > > <%@ page language="java" > import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> > <%^M > String query = "select * from patient_info where ref_client = 38 and > pat_lname like '%SM'ITH%';"; > DBConnectionManager connMgr; > connMgr = DBConnectionManager.getInstance(); > Connection Conn = connMgr.getConnection("podb"); > Statement SQLS = Conn.createStatement(); > ResultSet rs = SQLS.executeQuery(query); > String col1 = null; > String col2 = null; > while(rs.next()) { > col1 = rs.getString("pat_id"); > col2 = rs.getString("pat_fname"); > %> > <%=col1%>: <%=col2%> > > <% > } > rs.close(); > SQLS.close(); > connMgr.freeConnection("podb",Conn); > %> > > As you can see I did a syntax error in the query and the error comes to the > screen as expected > > javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at > character 74 > > I said that's weird so I tried to compare my complicated JSP files to what I > have here to see what is different (if I did something wrong) and I found > this > > If I add an include at certain parts of the page - I see the result I was > talking about. For example if I do this: > > > <%@ page language="java" > import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> > <%^M > String query = "select * from patient_info where ref_client = 38 and > pat_lname like '%SM'ITH%';"; > DBConnectionManager connMgr; > connMgr = DBConnectionManager.getInstance(); > Connection Conn = connMgr.getConnection("podb"); > Statement SQLS = Conn.createStatement(); > ResultSet rs = SQLS.executeQuery(query); > String col1 = null; > String col2 = null; > while(rs.next()) { > col1 = rs.getString("pat_id"); > col2 = rs.getString("pat_fname"); > %> > <%=col1%>: <%=col2%> > > <% > } > rs.close(); > SQLS.close(); > connMgr.freeConnection("podb",Conn); > %> > > I get the error page as I should - however If I move the include to below > the <%@ page language="java" - I get a blank page!! > > Now here is where it gets weirder - if I force a java syntax error like as > follows (I corrected the query): > > > <%@ page language="java" > import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> > <%^M > String query = "select * from patient_info where ref_client = 38 and > pat_lname like '%SMITH%';"; > DBConnectionManager connMgr; > connMgr = DBConnectionManager.getInstance(); > Connection Conn = connMgr.getConnection("podb"); > Statement SQLS = Conn.createStatement(); > ResultSet rs = SQLS.executeQuery(query); > String col1 = null; > String col2 = null; > if (col1.equals("yes") { > //test >} > while(rs.next()) { > col1 = rs.getString("pat_id"); > col2 = rs.getString("pat_fname"); > %> > <%=col1%>: <%=col2%> > > <% > } > rs.close(); > SQLS.close(); > connMgr.freeConnection("podb",Conn); > %> > > An error will get thrown to the screen > > org.apache.jasper.JasperExcep
Re: Error 500 messages
This line will commit the response and send html back to the client. Once that is done - no error messages will be sent back to the client and you will end up with a blank screen. -Tim Adile Abbadi wrote: Hi Rob, Thanx for this - this is great - I may have to use this because I think I have truly found a bug in Tomcat as this issue is not happening on my Tomcat 3 server. I did a bit more investigation and I found some interesting things. This is going to be a long email with code and stuff but whoever wants to read it please do - because the results are weird. I created the following simple JSP page <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> As you can see I did a syntax error in the query and the error comes to the screen as expected javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at character 74 I said that's weird so I tried to compare my complicated JSP files to what I have here to see what is different (if I did something wrong) and I found this If I add an include at certain parts of the page - I see the result I was talking about. For example if I do this: <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> I get the error page as I should - however If I move the include to below the <%@ page language="java" - I get a blank page!! Now here is where it gets weirder - if I force a java syntax error like as follows (I corrected the query): <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SMITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; if (col1.equals("yes") { //test } while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> An error will get thrown to the screen org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 2 in the jsp file: /testdb.jsp /var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')' expected if (col1.equals("yes") { However if I try to force a null pointer error by correcting my syntax error - I get a blank screen! If remove the include I get the null pointer error no problem. The other behaviour I noticed as well is that as I said before if the include is above the <%@ page language piece it works fine - only if its an html - if its another jsp file - I get a blank screen as well. So has anyone else seen this behaviour - is there a fix or a work around - should I got back to Tomcat 3?? I'm going to try your suggestion Rob and see if that helps at all, but to me its seems like an issue with the JSP compiler. Cheers Adile - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error 500 messages
Hi Rob, Thanx for this - this is great - I may have to use this because I think I have truly found a bug in Tomcat as this issue is not happening on my Tomcat 3 server. I did a bit more investigation and I found some interesting things. This is going to be a long email with code and stuff but whoever wants to read it please do - because the results are weird. I created the following simple JSP page <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> As you can see I did a syntax error in the query and the error comes to the screen as expected javax.servlet.ServletException: ERROR: syntax error at or near "ITH" at character 74 I said that's weird so I tried to compare my complicated JSP files to what I have here to see what is different (if I did something wrong) and I found this If I add an include at certain parts of the page - I see the result I was talking about. For example if I do this: <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SM'ITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> I get the error page as I should - however If I move the include to below the <%@ page language="java" - I get a blank page!! Now here is where it gets weirder - if I force a java syntax error like as follows (I corrected the query): <%@ page language="java" import="javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager" %> <%^M String query = "select * from patient_info where ref_client = 38 and pat_lname like '%SMITH%';"; DBConnectionManager connMgr; connMgr = DBConnectionManager.getInstance(); Connection Conn = connMgr.getConnection("podb"); Statement SQLS = Conn.createStatement(); ResultSet rs = SQLS.executeQuery(query); String col1 = null; String col2 = null; if (col1.equals("yes") { //test } while(rs.next()) { col1 = rs.getString("pat_id"); col2 = rs.getString("pat_fname"); %> <%=col1%>: <%=col2%> <% } rs.close(); SQLS.close(); connMgr.freeConnection("podb",Conn); %> An error will get thrown to the screen org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 2 in the jsp file: /testdb.jsp /var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')' expected if (col1.equals("yes") { However if I try to force a null pointer error by correcting my syntax error - I get a blank screen! If remove the include I get the null pointer error no problem. The other behaviour I noticed as well is that as I said before if the include is above the <%@ page language piece it works fine - only if its an html - if its another jsp file - I get a blank screen as well. So has anyone else seen this behaviour - is there a fix or a work around - should I got back to Tomcat 3?? I'm going to try your suggestion Rob and see if that helps at all, but to me its seems like an issue with the JSP compiler. Cheers Adile -Original Message- From: Rob Hills [mailto:[EMAIL PROTECTED] Sent: July 21, 2005 9:36 PM To: tomcat-user@jakarta.apache.org Subject: RE: Error 500 messages Hi Adile, I did say it was untested, and I've spotted a probl
RE: Error 500 messages
Hi Adile, I did say it was untested, and I've spotted a problem in my code already (why are bugs so invisible BEFORE you press the send button??!!) On 22 Jul 2005 at 9:41, Rob Hills wrote: > Something like the following (untested) in your error.jsp should do the trick: > > <% > if (exception == null) { > %> > A null exception was encountered > <% > } else { > if (exception instanceof SQLException) { > Exception e = exception; // WRONG the line above should read: SQLException e = (SQLException)exception; > while (e != null) { > %> > Error Code: <%=e.getErrorCode()%> > Message: <%=e.getMessage()%> > <% > e = e.getNextException(); > } > } else { > // non-sql error handling here... > } > } > > HTH, > > Rob Hills > www.netpaver.com.au > Western Australia > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > Rob Hills MBBS, Grad Dip Com Stud, MACS Senior Consultant Netpaver Web Solutions Tel:(08) 9485 2555 Mob:(0412) 904 357 Fax:(08) 9485 2555 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error 500 messages
Hi Adile, On 21 Jul 2005 at 19:09, Adile Abbadi wrote: > Now I did a little more experimenting and discovered something interesting - > as I said I can get an exception to be thrown to the page in a simple JSP > file (I made it do a null pointer for example) and I can get it do pretty > any other exception as well. Now what I did is I took one my more > complicated JSP pages, made a copy and made a few changes to force some > exceptions - now here is the weird thing - some exceptions are thrown to the > screen and some are not. > > For example I had a ResultSet DB object and I made a syntax error and I got > an Error 500 screen to come up as follows (note I took out the extra stuff > to shorten the email) > > org.apache.jasper.JasperException: Unable to compile class for JSP Note, you will always get a stacktrace if Tomcat can't compile a JSP - I believe this is appropriate as this is a "developer" error rather than a "runtime" error. > However I tried to get it to do a syntax error in the query - and I end up > with a blank page. The catalina log shows nothing, but my context log shows > the following (clown is the word I used to screw up the query) > > javax.servlet.ServletException: ERROR: syntax error at or near "CLOWN" at > character 260 > > --Root Cause-- > java.sql.SQLException: ERROR: syntax error at or near "CLOWN" at character > 260 > > Its almost as it the page refuses to compile with this error. No, it has compiled OK or else you'd get the same kind of message as you did previously. I suspect the reason you get a blank page is that for reason's I've never been able to discover, SQL Exceptions are nested and the last error (the one shown on your error page) is always empty :-( to see the true error(s), you have to write some code that works its way back through the nested SQL Exceptions, printing out the message for each as you go. Something like the following (untested) in your error.jsp should do the trick: <% if (exception == null) { %> A null exception was encountered <% } else { if (exception instanceof SQLException) { Exception e = exception; while (e != null) { %> Error Code: <%=e.getErrorCode()%> Message: <%=e.getMessage()%> <% e = e.getNextException(); } } else { // non-sql error handling here... } } HTH, Rob Hills www.netpaver.com.au Western Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error 500 messages
Hi Anoop thanx for your help - first in regards to the file that the log is writing to I'm referring to a log file I created for my context in the XML supporting that context using the FileLogger (similar to as you have below). Now I did a little more experimenting and discovered something interesting - as I said I can get an exception to be thrown to the page in a simple JSP file (I made it do a null pointer for example) and I can get it do pretty any other exception as well. Now what I did is I took one my more complicated JSP pages, made a copy and made a few changes to force some exceptions - now here is the weird thing - some exceptions are thrown to the screen and some are not. For example I had a ResultSet DB object and I made a syntax error and I got an Error 500 screen to come up as follows (note I took out the extra stuff to shorten the email) org.apache.jasper.JasperException: Unable to compile class for JSP /var/lib/tomcat4/work/Standalone/localhost/podims/mod_pat_test_jsp.java:118: ')' expected while(SQLR.next() { I also got it do a null pointer exception: org.apache.jasper.JasperException Root Cause java.lang.NullPointerException However I tried to get it to do a syntax error in the query - and I end up with a blank page. The catalina log shows nothing, but my context log shows the following (clown is the word I used to screw up the query) javax.servlet.ServletException: ERROR: syntax error at or near "CLOWN" at character 260 --Root Cause-- java.sql.SQLException: ERROR: syntax error at or near "CLOWN" at character 260 Its almost as it the page refuses to compile with this error. Any ideas - is it a configuration thing? Thanx Adile -Original Message- From: Anoop kumar V [mailto:[EMAIL PROTECTED] Sent: July 21, 2005 6:32 PM To: Tomcat Users List Subject: Re: Error 500 messages It might be easier than you think to output the error right onto the page itself. But would it help if you see the errors (+ other things) on the tomcat console?? It will certainly help in your debugging. To do that edit the server.xml in the conf directory and remove lines similar to this: The only problem I have seen when I do this is that a lot of information prints out on to the console and makes it cluttered - but my hope is that when you get an error/exception you will be able to notice it in the console amidst all the other debugging info. Also ensure that the debug has the value 0 in the host tag. This will reduce the amount of debugging info. Another point I wish to make is that when there is an error tomcat just writes one file I am not sure which files you mention that tomcat writes The easiest thing I do and it works too is that - everything is outputted into my one output file catalina.out and I use "tail -f catalina.out" to see what is going on - of course this works only on *nix servers (pity windows!!)... HTH, Anoop On 7/21/05, Adile Abbadi <[EMAIL PROTECTED]> wrote: > > Hi all, > > I've got a very simple question to ask and I'm sure someone out there can > help me. Ok I just migrated from Tomcat 3 to Tomcat 4 and everything is > working great except one little thing. But a little background before I go > on. > > Apache/Tomcat4 configuration - using libapache-mod_jk as the connector. > Running on Linux > JDK1.4 > > My app is built in JSP with JavaBeans in the background. Most of JSP's are > built as follows > > Container JSP file > --jsp includes doing different thing like load session variables or nav > menus, etc. > > Alright so here is the issue - in Tomcat 3 - whenever an error occurred such > as a null pointer, or other exception - the error would output right to the > JSP page itself and I could see it on the screen. > > Now in Tomcat 4 it outputs the error to the log. This is all fine and dandy > but it makes it hell to try and fix issues having to sift through log files > to figure out what the problem is. > > Now I have tried to build a simple test.jsp file and force it to through an > exception and that works fine (gives me the standard apache/tomcat error 500 > screen) - but for some reason in the more complicated jsp pages - I can't > get the exception to come to the screen. > > So any ideas?? > > Thanx > > Adile > > Mr. Adile Abbadi-MacIntosh - Chief Technical Officer > > > A: Suite 500 - 400 Crowfoot Cres NW > Calgary, Alberta, Canada > T3G 5H6 P: 403.693.2609 > F: 403.693.2604 > E: [EMAIL PROTECTED] C: 403.383.5285 > > -- Thanks and best regards, Anoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in t
Re: Error 500 messages
It might be easier than you think to output the error right onto the page itself. But would it help if you see the errors (+ other things) on the tomcat console?? It will certainly help in your debugging. To do that edit the server.xml in the conf directory and remove lines similar to this: The only problem I have seen when I do this is that a lot of information prints out on to the console and makes it cluttered - but my hope is that when you get an error/exception you will be able to notice it in the console amidst all the other debugging info. Also ensure that the debug has the value 0 in the host tag. This will reduce the amount of debugging info. Another point I wish to make is that when there is an error tomcat just writes one file I am not sure which files you mention that tomcat writes The easiest thing I do and it works too is that - everything is outputted into my one output file catalina.out and I use "tail -f catalina.out" to see what is going on - of course this works only on *nix servers (pity windows!!)... HTH, Anoop On 7/21/05, Adile Abbadi <[EMAIL PROTECTED]> wrote: > > Hi all, > > I've got a very simple question to ask and I'm sure someone out there can > help me. Ok I just migrated from Tomcat 3 to Tomcat 4 and everything is > working great except one little thing. But a little background before I go > on. > > Apache/Tomcat4 configuration - using libapache-mod_jk as the connector. > Running on Linux > JDK1.4 > > My app is built in JSP with JavaBeans in the background. Most of JSP's are > built as follows > > Container JSP file > --jsp includes doing different thing like load session variables or nav > menus, etc. > > Alright so here is the issue - in Tomcat 3 - whenever an error occurred such > as a null pointer, or other exception - the error would output right to the > JSP page itself and I could see it on the screen. > > Now in Tomcat 4 it outputs the error to the log. This is all fine and dandy > but it makes it hell to try and fix issues having to sift through log files > to figure out what the problem is. > > Now I have tried to build a simple test.jsp file and force it to through an > exception and that works fine (gives me the standard apache/tomcat error 500 > screen) - but for some reason in the more complicated jsp pages - I can't > get the exception to come to the screen. > > So any ideas?? > > Thanx > > Adile > > Mr. Adile Abbadi-MacIntosh - Chief Technical Officer > > > A: Suite 500 - 400 Crowfoot Cres NW > Calgary, Alberta, Canada > T3G 5H6 P: 403.693.2609 > F: 403.693.2604 > E: [EMAIL PROTECTED] C: 403.383.5285 > > -- Thanks and best regards, Anoop - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error 500 messages
Hi all, I've got a very simple question to ask and I'm sure someone out there can help me. Ok I just migrated from Tomcat 3 to Tomcat 4 and everything is working great except one little thing. But a little background before I go on. Apache/Tomcat4 configuration - using libapache-mod_jk as the connector. Running on Linux JDK1.4 My app is built in JSP with JavaBeans in the background. Most of JSP's are built as follows Container JSP file --jsp includes doing different thing like load session variables or nav menus, etc. Alright so here is the issue - in Tomcat 3 - whenever an error occurred such as a null pointer, or other exception - the error would output right to the JSP page itself and I could see it on the screen. Now in Tomcat 4 it outputs the error to the log. This is all fine and dandy but it makes it hell to try and fix issues having to sift through log files to figure out what the problem is. Now I have tried to build a simple test.jsp file and force it to through an exception and that works fine (gives me the standard apache/tomcat error 500 screen) - but for some reason in the more complicated jsp pages - I can't get the exception to come to the screen. So any ideas?? Thanx Adile Mr. Adile Abbadi-MacIntosh - Chief Technical Officer A: Suite 500 - 400 Crowfoot Cres NWCalgary, Alberta, CanadaT3G 5H6 P: 403.693.2609 F: 403.693.2604 E: [EMAIL PROTECTED] C: 403.383.5285