Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalStateException + struts + JasperPrint

 
Rafael Fagundes
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Alexis Ekkehard
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic