Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exception

 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting this exception and am not able to narrow it. Anyone has an idea?

java.lang.IllegalStateException: getWriter() has already been called for this response
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is one of the clearest exceptions that you can get. It really means what it says.
You must search your code for "getWriter" or "getOutputStream" - wasn't there also a line number? That should help.
 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not as it was saying actually. There was a null pointer exception masked inside. The XML document's rot that I was creating was being referenced before it was initialized. Iwas able to get to the exception by priting the stacktrace which I was not doing before.
Thanks,
Vasu
 
himanshu patel
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you close the outputStream ?
 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not closing the outputStream at any time. In this particular instance it was not the problem of not closing it. But what if I never close it, as what I am doing now... I didn't face any problem so far.
Vasu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic