RE: Illegal State Exception - Even more!
AH! *So*, the theory here is that I am generating more than the 8kb of data, which is being autocommited to the browser, then an error occurs and the servlet cannot send the error, but instead raises this exception. Got it. In fact, I write a large form back in html. If the last element were to be null, and I try to write out a value thus: Sadly, I raised the memory to 500kb, carried on developing and just got this a fwe minutes ago: Error: 500 Location: /pod_users/justin/jsp/form.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(HttpServletRespon seFacade.java:157) at org.apache.jasper.runtime.JspServlet.unknownException(JspServlet.java:299) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection (Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338 ) at java.lang.Thread.run(Thread.java:484) Which again leaves me none the wiser in terms of tracing the error. HOWEVER I have just had a realisation. I had just altered and rebuilt some of the classes that operate behind the scenes and one of them had failed and so wasn't present in the .jar file. I corrected it and rebuild the .jar and the error went away. Now, I would have expected an error about not being able to instantiate the class, but the above is what I got (simply reproduceable too I should think). Is this a bug? I guess not, just a feature of how the containter falls over when you pull the rug out from under its feet. J. -- You're only jealous cos the little penguins are talking to me. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Illegal State Exception - Even more!
The increase in memory probably didn't affect the buffer size. For JSP, the JspWriter's buffer may be increased with: %@ page buffer=size % where the size is a value in kbytes, i.e. 32 or 32kb. The default is 8kb. For servlets, you can use: ServletResponse.setBufferSize(size); where size is in bytes. The default is also 8k. Be sure to call setBufferSize() before writting any content or you will get another form of IllegalStateException. Cheers, Larry -Original Message- From: Justin Rowles [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 10:03 AM To: 'Tomcat Users List' Subject: RE: Illegal State Exception - Even more! AH! *So*, the theory here is that I am generating more than the 8kb of data, which is being autocommited to the browser, then an error occurs and the servlet cannot send the error, but instead raises this exception. Got it. In fact, I write a large form back in html. If the last element were to be null, and I try to write out a value thus: Sadly, I raised the memory to 500kb, carried on developing and just got this a fwe minutes ago: Error: 500 Location: /pod_users/justin/jsp/form.jsp Internal Servlet Error: java.lang.IllegalStateException: Response has already been committed at org.apache.tomcat.core.HttpServletResponseFacade.sendError(Htt pServletRespon seFacade.java:157) at org.apache.jasper.runtime.JspServlet.unknownException(JspServl et.java:299) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:377) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWra pper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.pro cessConnection (Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEnd point.java:338 ) at java.lang.Thread.run(Thread.java:484) Which again leaves me none the wiser in terms of tracing the error. HOWEVER I have just had a realisation. I had just altered and rebuilt some of the classes that operate behind the scenes and one of them had failed and so wasn't present in the .jar file. I corrected it and rebuild the .jar and the error went away. Now, I would have expected an error about not being able to instantiate the class, but the above is what I got (simply reproduceable too I should think). Is this a bug? I guess not, just a feature of how the containter falls over when you pull the rug out from under its feet. J. -- You're only jealous cos the little penguins are talking to me. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Illegal State Exception - Even more!
The increase in memory probably didn't affect the buffer size. For JSP, the JspWriter's buffer may be increased with: %@ page buffer=size % Whoops, didn't say what I meant. That (the above) is exactly what I did - to 500kb I can get a Response has already been committed exception at will by compiling the jsp, then removing a class file from a jar. Putting the class file back in the jar again removes the error. Justin. -- You're only jealous cos the little penguins are talking to me. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Illegal State Exception - Even more!
If the class in question isn't involved in the amount of content written, then I don't have an explanation. If possible, you could sprinkle some JspWriter.getRemaining() calls around to see if you can detect any differences when the class is present or not. Cheers, Larry -Original Message- From: Justin Rowles [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 20, 2001 10:44 AM To: 'Tomcat Users List' Subject: RE: Illegal State Exception - Even more! The increase in memory probably didn't affect the buffer size. For JSP, the JspWriter's buffer may be increased with: %@ page buffer=size % Whoops, didn't say what I meant. That (the above) is exactly what I did - to 500kb I can get a Response has already been committed exception at will by compiling the jsp, then removing a class file from a jar. Putting the class file back in the jar again removes the error. Justin. -- You're only jealous cos the little penguins are talking to me. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Illegal State Exception - Even more!
If the class in question isn't involved in the amount of content written, then I don't have an explanation. The method I was calling returns a String which is returned to a method in another class and returned again to the call in the jsp where it is written out as output. Does that count?! ;-) If possible, you could sprinkle some JspWriter.getRemaining() calls around to see if you can detect any differences when the class is present or not. Whassat then? fx: goes and searches like a good little boy Oh, right, yeah, OK, I can do that, and send the output to our logging facility. I'll let you know the results. Do please (anyone) answer the above first though, in case it makes the rest irrelevent. J. -- You're only jealous cos the little penguins are talking to me. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]