facebook

java.lang.IllegalStateException: OutputStream already obtain

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #244448 Reply

    David
    Member

    I am using Struts 1.1 on WebSphere 5.0 and quite often I get this error message. I heard this was a struts issue, because we don’t directly get the outputstream from a servlet, but thru the Action. Is this true? If so, does anyone know a workaround to this? I have noticed that the following is included in the output the user receives:
    “Error 500: OutputStream already obtained”

    Here is how I cause this in my action class:

    OutputStream os = response.getOutputStream();
    int k = 0;
    String s;
    for (int aa= 0; aa< items.size(); aa ++) {
    k++;
    s = (String)items.get(aa);
    if (s != null) {
    os.write(s.getBytes());
    }
    }

    if (os != null ) {
    os.close();
    }

    #244462 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    Sorry sonoerin, I’ve never seen this. Can you reproduce it quickly enough that you could test your app on Tomcat or JBoss and see if it occurs there? If it does, then it is likely a Struts issue, if not, then possibly a WS issue.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: java.lang.IllegalStateException: OutputStream already obtain

You must be logged in to post in the forum log in