You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Babu, Tinu" <Ti...@amd.com> on 2013/09/05 06:09:34 UTC

RE: JspTagException- Stream closed

 Here is the body of the method doEndTag(). The exception is thrown for line number 146, which is    this.iter = null;   of the reset method.

 public int doEndTag()
    throws JspException
  {
    if (this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent != null)
    {
      try
      {
        this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.writeOut(this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.getEnclosingWriter());
      }
      catch (IOException localIOException)
      {
        this.jdField_pageContext_of_type_JavaxServletJspPageContext.getServletContext().log(Res.getString(4), localIOException);
        throw new JspTagException(localIOException.getMessage());
      }
    }

    reset();

    return 6;
  }

  private void reset()
  {
    this.sDataSource = null;
    this.changeCurrentRow = true;
    this.useRange = false;
    this.ds = null;
    this.rs = null;
    this.iter = null;
  }




-----Original Message-----
From: Babu, Tinu [mailto:Tinu.Babu@amd.com] 
Sent: Monday, August 26, 2013 2:51 PM
To: Tomcat Users List
Subject: RE: JspTagException- Stream closed



The RowSetIterate tag is declared in the JSP itself. All the JSPs having this RowSetIterate tag is throwing Stream closed exception. 


-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net]
Sent: Wednesday, August 21, 2013 9:41 PM
To: Tomcat Users List
Subject: Re: JspTagException- Stream closed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Tinu,

On 8/20/13 9:59 PM, Babu, Tinu wrote:
> Here is the piece of codes which is throwing the error.
> 
> <select name="list1" size="15" multiple> <jbo:RowsetIterate 
> datasource="userRole" > <option value="<jbo:ShowValue 
> datasource="userRole"  dataitem="RoleName" />"> <jbo:ShowValue 
> datasource="userRole"  dataitem="RoleDesc" /> </option> 
> </jbo:RowsetIterate> </select>
> 
> <select name="list2" size="15" multiple> <jbo:RowsetIterate 
> datasource="roles" > <option value="<jbo:ShowValue datasource="roles"
> dataitem="RoleName" />"> <jbo:ShowValue datasource="roles"  
> dataitem="RoleDesc" /> </option> </jbo:RowsetIterate> </select>
> 
> Exception is always being thrown from the RowSetIterate Tags in JSPs. 
> This was working properly with Tomcat4 version and when we upgraded 
> our Tomcat to version 6 we started getting this strange exception.
> 
> Please share your thoughts.

Where is the row set itself declared? In the JSP? In a servlet somewhere that executes before the JSP?

In general, I wouldn't recommend making any JDBC calls from within a
JSP: I prefer to take care of all data acquisition in a servlet (or
similar) before delegating the creation of a response to the view layer. But that's just me.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSFMNUAAoJEBzwKT+lPKRYRDUQAMs3ugmVpr/K0kGMRIV2xHvG
cb7Kd2uWrvAnFLqgbj6GuMFQvWsTXcbA3tlaa+iY3FSQEchFnzktONVdqml6CGsB
UdumVqg0GFPI9vPM7nq4EOxTZg6QlaVsy2LJ0hbmc4vFaYD6s4uz21yd2IMZ8MJy
FjGx6JylFn1c9RjLBegWRWUS3ykkapaZ8lwJU+QUnI1WxLp8mg37FV7ziwKIk5u5
yKc1nquQ/cj2aqUiEdpC2CEwmy05m2APiDmGT/UkKuZoHMRG1/OzLFlKg65RhlvB
x0iPSDZv6iP/neZEtGmOsYiQLG9F5/v4ziV+kgsJYbhmb6jtYIYiHcBYrn425Q2W
ERhqEuYRXR+2yRxt3/xzB0uSyg3eikhfwNoOrFH2OGgk4cpzSZJRW/E0N2EUYUwr
ZRuGpOr4wgpPOrJ3A02hGYpBz2ZtbiingTl/72IlLcgBnBUapWzSazPl4BE7gPe/
VToMDtlxm74qiqtvr8C8swGAK9Y2xwmFkFI2GF2tu7STgbDfIA7f8eILYo3+m57S
3oI/O4aVf38HiKuA5pZmahSU5mLtCi4Fj0RmzDSSwLgi0WYfgUzCsqKDJKFns2qe
PRNEyA8w7X4IKI4oJKgP/C7+gl3g8xycEo2C04Q6ZlZHjqfSBqJi6KnxJfdZLoYt
t18eSlW8KZBzKKHP7QpT
=011K
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: JspTagException- Stream closed

Posted by Martin Gainty <mg...@hotmail.com>.
where is the iter attribute declaration for selection HTML tag?

http://www.w3schools.com/tags/tag_select.asp

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.




> From: Tinu.Babu@amd.com
> To: users@tomcat.apache.org
> Subject: RE: JspTagException- Stream closed
> Date: Thu, 5 Sep 2013 04:09:34 +0000
> 
>  Here is the body of the method doEndTag(). The exception is thrown for line number 146, which is    this.iter = null;   of the reset method.
> 
>  public int doEndTag()
>     throws JspException
>   {
>     if (this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent != null)
>     {
>       try
>       {
>         this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.writeOut(this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.getEnclosingWriter());
>       }
>       catch (IOException localIOException)
>       {
>         this.jdField_pageContext_of_type_JavaxServletJspPageContext.getServletContext().log(Res.getString(4), localIOException);
>         throw new JspTagException(localIOException.getMessage());
>       }
>     }
> 
>     reset();
> 
>     return 6;
>   }
> 
>   private void reset()
>   {
>     this.sDataSource = null;
>     this.changeCurrentRow = true;
>     this.useRange = false;
>     this.ds = null;
>     this.rs = null;
>     this.iter = null;
>   }
> 
> 
> 
> 
> -----Original Message-----
> From: Babu, Tinu [mailto:Tinu.Babu@amd.com] 
> Sent: Monday, August 26, 2013 2:51 PM
> To: Tomcat Users List
> Subject: RE: JspTagException- Stream closed
> 
> 
> 
> The RowSetIterate tag is declared in the JSP itself. All the JSPs having this RowSetIterate tag is throwing Stream closed exception. 
> 
> 
> -----Original Message-----
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Sent: Wednesday, August 21, 2013 9:41 PM
> To: Tomcat Users List
> Subject: Re: JspTagException- Stream closed
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Tinu,
> 
> On 8/20/13 9:59 PM, Babu, Tinu wrote:
> > Here is the piece of codes which is throwing the error.
> > 
> > <select name="list1" size="15" multiple> <jbo:RowsetIterate 
> > datasource="userRole" > <option value="<jbo:ShowValue 
> > datasource="userRole"  dataitem="RoleName" />"> <jbo:ShowValue 
> > datasource="userRole"  dataitem="RoleDesc" /> </option> 
> > </jbo:RowsetIterate> </select>
> > 
> > <select name="list2" size="15" multiple> <jbo:RowsetIterate 
> > datasource="roles" > <option value="<jbo:ShowValue datasource="roles"
> > dataitem="RoleName" />"> <jbo:ShowValue datasource="roles"  
> > dataitem="RoleDesc" /> </option> </jbo:RowsetIterate> </select>
> > 
> > Exception is always being thrown from the RowSetIterate Tags in JSPs. 
> > This was working properly with Tomcat4 version and when we upgraded 
> > our Tomcat to version 6 we started getting this strange exception.
> > 
> > Please share your thoughts.
> 
> Where is the row set itself declared? In the JSP? In a servlet somewhere that executes before the JSP?
> 
> In general, I wouldn't recommend making any JDBC calls from within a
> JSP: I prefer to take care of all data acquisition in a servlet (or
> similar) before delegating the creation of a response to the view layer. But that's just me.
> 
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.14 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iQIcBAEBCAAGBQJSFMNUAAoJEBzwKT+lPKRYRDUQAMs3ugmVpr/K0kGMRIV2xHvG
> cb7Kd2uWrvAnFLqgbj6GuMFQvWsTXcbA3tlaa+iY3FSQEchFnzktONVdqml6CGsB
> UdumVqg0GFPI9vPM7nq4EOxTZg6QlaVsy2LJ0hbmc4vFaYD6s4uz21yd2IMZ8MJy
> FjGx6JylFn1c9RjLBegWRWUS3ykkapaZ8lwJU+QUnI1WxLp8mg37FV7ziwKIk5u5
> yKc1nquQ/cj2aqUiEdpC2CEwmy05m2APiDmGT/UkKuZoHMRG1/OzLFlKg65RhlvB
> x0iPSDZv6iP/neZEtGmOsYiQLG9F5/v4ziV+kgsJYbhmb6jtYIYiHcBYrn425Q2W
> ERhqEuYRXR+2yRxt3/xzB0uSyg3eikhfwNoOrFH2OGgk4cpzSZJRW/E0N2EUYUwr
> ZRuGpOr4wgpPOrJ3A02hGYpBz2ZtbiingTl/72IlLcgBnBUapWzSazPl4BE7gPe/
> VToMDtlxm74qiqtvr8C8swGAK9Y2xwmFkFI2GF2tu7STgbDfIA7f8eILYo3+m57S
> 3oI/O4aVf38HiKuA5pZmahSU5mLtCi4Fj0RmzDSSwLgi0WYfgUzCsqKDJKFns2qe
> PRNEyA8w7X4IKI4oJKgP/C7+gl3g8xycEo2C04Q6ZlZHjqfSBqJi6KnxJfdZLoYt
> t18eSlW8KZBzKKHP7QpT
> =011K
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
 		 	   		  

Re: JspTagException- Stream closed

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Babu,

On 9/5/13 12:09 AM, Babu, Tinu wrote:
> Here is the body of the method doEndTag(). The exception is thrown 
> for line number 146, which is this.iter = null; of the reset
> method.
> 
> public int doEndTag() throws JspException { if
> (this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent
> != null) { try { 
> this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.writeOut(this.jdField_bodyContent_of_type_JavaxServletJspTagextBodyContent.getEnclosingWriter());
>
> 
}
> catch (IOException localIOException) { 
> this.jdField_pageContext_of_type_JavaxServletJspPageContext.getServletContext().log(Res.getString(4),
> localIOException); throw new
> JspTagException(localIOException.getMessage()); } }
> 
> reset();
> 
> return 6; }
> 
> private void reset() { this.sDataSource = null; 
> this.changeCurrentRow = true; this.useRange = false; this.ds =
> null; this.rs = null; this.iter = null; }

I'll eat my hat if "this.iter = null;" is throwing a JspTagException
(especially one whose stack trace does not include the "reset"
method). I think you are looking at source code that does not match
the exception stack trace you are seeing.

You should be seeing another stack trace (in the application log,
according to the source I see above) that includes full details of the
IOException that is being caught and re-thrown as a JspTagException --
without including the "cause" when creating the new exception. Bad
Oracle! Bad!

If you find that exception, it might give you better information about
why it's happening in the first place.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSKL7gAAoJEBzwKT+lPKRYu2AQAJypAp+njffwNgQnTfG3vgQv
1V7hauPzcVAtgHLYDGxaOl12/yXNOZ4Mhz15JsOWQxYPCXjWBsvtWEmhjVOK8AcE
kQZWV7AAvc/4Tg+SSHgjgJNSAD0geSyD3w7x5DwAanE6qdHa42mW8+W/jj+ru9aC
mJHztYIYhl35EMoVJAhRhvAXLqazcr/TQPdSvui6meXLcYAdvioNOq1e+WstCay/
eoBBfcv1Tod1vJKd6jvGCx6ljjyJnk+/0+y+O3UaE2a3lSTJym1GveGgTzwerJN6
WarE2q3rXP/GqfiwZxVj9XqyKC+2yfJSBCSoxQCGWX5wLnosXVKEU0GMFNpBjlEr
mVnpWf7CuYFEnQ/xUfrT7fawepP1dPBszozJlwmVM0UAA+jIeJs86n1o8s7LJXqN
+I47Ymo4mFODpXuPrgI+ijn+HSxFm6urckHOJRdEbTyMmPw6eGzKOMVua4GTGC96
U1nlS0yqm4G7AgJVqxs8I5aQ4zXxg08g9k39YUH5Rrs6tCoLX56pzQZO35bEyMn/
Rlx9Cb0Mu8LSsSyGQrscYLe5Lh4A5fW4WKiIahkgTwdiRGQY6YXWHGK7TAbHM8DT
xy7DwdF/GS9Enqq6nRWeMQyyAxG9q4dHxU5+Cf5HJDPIgnfGdUcshODK9I3mptQb
rUfqatQh5TYRwLBtlDAQ
=T0VJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org