Because tomcat 4.1.12 use a tag pool, when you use style tag using xml or xsl inside body, it throw an exception once on two. I know why and I know how to correct it : public int doAfterBody() throws JspException { if ( bodyContent != null ) { String text = bodyContent.getString().trim(); if ( text.length() > 0 ) { if ( xsl == null ) {^ ^^^^^^^^^^^^^^^^^^ xsl = new StringReader( text ); } else if ( xml == null ) { ^^^^^^^^^^^^^^^^^^ xml = new StringReader( text ); } ... It test if xml or xsl is null, or because it use a pool, first time it access to xml in body, it create a StringReader, secund times, it did not create a new one (because xml is not null) and you will have an exception because this reader is closed. To correct this bug, add destroying xml and xsl variable in doEndTag in finally section : finally { stringWriter = null; xml=null; xsl=null; } Best, Teva Lautier
It looks like this might be caused by Bug #13667.
*** Bug 17053 has been marked as a duplicate of this bug. ***
Resolving. Taglib has been retired.