• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Cancelling a file download - "java.lang.IllegalStateException: getOutputStream() ..."

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know a similar question has been asked before but I have not been able to solve my problem, I am unable to find any similar problems and solutions on any other forums.

I am developing a Struts 1.3 application which uses tiles, running on Tomcat 5.5. The download page uses a instance of Struts DownloadAction.

A user can successfully download a file. However the problem occurs if a user clicks to download a file, then from the 'Save/Cancel' dialog box clicks 'Cancel' at which point an exception is thrown, worryingly the console will continue to output exception stack trace for about 10 minutes before normal service is resumed!

To 'prove' where the issues arises I have run the software on both Linux and XP environments with the same outcome.

It starts to get interesting when I use a different browser, my target browser is IE 6, i get the same problem with IE 7 however using firefox 3.0.10 the error is not caused! I suspect the problem is down to the output stream being created for the file, perhaps firefox closes it properly when cancel is clicked but IE doesn't, in either case I would expect the code which manages to download on the server side to handle the error more elegantly.
Additionally files smaller than about 2Mb do not have the problem in IE.
I have knocked up a simple application which uses the download action but not running in the tiles framework, and this does not exhibit the problem, although it also does not include other elements of my full system, e.g. Acegi, various logging filters etc.

I would be grateful if anyone could offer some insight into what is causing this problem, or why the exception trace is so long if no actual fix is possible. if it is tiles (as has been suggested) to blame then we could look at alternatives to get around this problem.

(I keep getting an error trying to upload my stack trace in an attached file)
 
Power corrupts. Absolute power xxxxxxxxxxxxxxxx is kinda neat.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic