Am 18.05.2017 um 19:01 schrieb Mark Thomas:
On 17/05/2017 14:32, Michael Heinen wrote:
I am currently migrating a web app from Tomcat 7.0.73 to 8.5.15. An embedded Tomcat is used on development systems.

The web-inf/lib folder of the application contains a jar with a SAXParserFactory implementation. This SAXParserFactory is now used with TC 8.5 by the WebXmlParser in order to parse the web.xml (and fails unfortunately). The ServiceLoader finds the jar because the ParallelWebappClassLoader is used for the lookup.

TC 7.0.73 uses the sun.misc.Launcher$AppClassLoader and does therefore not use the jar under web-inf\lib. It creates the webXml Digester in the init() phase of the stanrardContext. TC 8.5 does this in the startInternal() phase where the ParallelWebappClassLoader is instantiated and bound to the current thread.

Specifying "javax.xml.parsers.SAXParserFactory" as VM param solves the issue of course.

I think this is the fix that triggered this:
https://svn.apache.org/viewvc?view=revision&revision=1731216

My question:
Is this behaviour expected?

It looks like an unintended side-effect of the change.

Should Tomcat use libraries of the web app for the startup of a context, here for web-xml parsing?

The change has been in place for over a year and this is the first problem we have seen. I'm curious, what exactly was the problem you saw?
A commercial third party web application contains some oracle database jars. This application is not yet released for Tomcat 8.5. One of these jars contains a SAXParserFactory implementation which references a class from another oracle jar which we do not have. Therefore a ClassNotFoundException occurred. Nothing to blame Tomcat for. The third party webApp is not packaged correctly and not ready for TC 8.5.

I just noticed this changed behaviour and wanted to let you know about it.
Maybe it is relevant for others or maybe it is something you want to fix in order to make the start procedure more robust.


I'd probably lean towards fixing this on the grounds that you want to parsing of web.xml to be deterministic rather than dependent on what may, or may not, be included in the app.

What do others think?

Mark

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




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

Reply via email to