File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes java.lang.IllegalStateException + struts + JasperPrint Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "java.lang.IllegalStateException + struts + JasperPrint " Watch "java.lang.IllegalStateException + struts + JasperPrint " New topic
Author

java.lang.IllegalStateException + struts + JasperPrint

Rafael Fagundes
Ranch Hand

Joined: Sep 23, 2004
Posts: 52
Hi.

First of all, I read the topic http://faq.javaranch.com/view?IllegalStateException. But still in doubt since my scenario goes like this:

#1. Web application, using RAD and Struts (servlets, filters, actions, and so on....)
#2. A request to generate a PDF, after the Action.execute processing, works like this:


#3. After the execution above, my filter is throwing the exception whit the warning:


WARNING: Cannot set status. Response already committed.
WARNING: Cannot set header. Response already committed.
javax.servlet.ServletException: getOutputStream() has already been called for this response
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:166)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)


What should I do to avoid this cenario?

RegardĀ“s,
Rafael.


Thanks,
Rafa
Alexis Ekkehard
Greenhorn

Joined: Oct 08, 2009
Posts: 1
We solved a similar exception related with sendredirect using lady4j. In our case the problem was that we already retrieved the outputstream and we tried to redirect... be careful with that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.IllegalStateException + struts + JasperPrint
 
Similar Threads
Refresh everything in jsp and start over
Struts 2 Remote Div Problem
Urgent! Strange problem when calling jasper report in STRUTS
how to trigger a servlet from JSF
Exception while writing to output stream