https://bz.apache.org/bugzilla/show_bug.cgi?id=61364

            Bug ID: 61364
           Summary: Stream not closed when detecting encoding of a JSP
           Product: Tomcat 8
           Version: 8.5.16
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
          Assignee: dev@tomcat.apache.org
          Reporter: peter.stoc...@alphabot.com
  Target Milestone: ----

We had an issue that prevented us from deleting certain JSPs in an embedded
Tomcat.
The cause of that seems to be that an InputStream is not closed after trying to
figure out the encoding of a .jsp file.

>From our point of view this seems to affect at least Tomcat 8.5.16 with
following classes involved:

org.apache.jasper.compiler.ParserController:
> 321: InputStream inStream = JspUtil.getInputStream(absFileName, jar, ctxt);
> 322: EncodingDetector encodingDetector = new EncodingDetector(inStream);
=> The InputStream is retrieved and passed to the EncodingDetector.


org.apache.jasper.compiler.EncodingDetector:
> 96:  XMLStreamReader xmlStreamReader = 
> XML_INPUT_FACTORY.createXMLStreamReader(stream);
=> The EncodingDetector creates an XMLStreamReader on its static
XML_INPUT_FACTORY.


As a workaround we configured the JspConfig like this to prevent the detection
of the encoding:

> <jsp-config>
>   <jsp-property-group>
>     <url-pattern>*.jsp</url-pattern>
>     <is-xml>false</is-xml>
>   </jsp-property-group>
> </jsp-config>

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to