Bug 63358 - Allow exceptions thrown by Connector.start() when adding a connector to be caught and handled in code that embeds Tomcat
Summary: Allow exceptions thrown by Connector.start() when adding a connector to be ca...
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.x
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2019-04-17 07:26 UTC by Andy Wilkinson
Modified: 2019-04-29 13:06 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Andy Wilkinson 2019-04-17 07:26:27 UTC
This is a follow-on from https://bz.apache.org/bugzilla/show_bug.cgi?id=60152.
When a connector is added to StandardService it calls Connector.start() if the
service is available. If the connector throws an exception it is caught, logged, and swallowed [1]. This prevents an embedder from handling the exception.

Could a similar change to [2] please be made that makes it possible for an embedder to catch and handle the exception themselves?

[1] https://github.com/apache/tomcat/blob/d7a770acf8761c42958b56d6ce4864e32f8a9957/java/org/apache/catalina/core/StandardService.java#L227
[2] http://svn.apache.org/viewvc?view=revision&revision=1763769
Comment 1 Remy Maucherat 2019-04-17 08:54:54 UTC
I was going to complain, but ContainerBase.addChildInternal has a template for that.
Comment 2 Mark Thomas 2019-04-29 13:06:33 UTC
Fixed in:
- master for 9.0.20 onwards