Bug 63358

Summary: Allow exceptions thrown by Connector.start() when adding a connector to be caught and handled in code that embeds Tomcat
Product: Tomcat 9 Reporter: Andy Wilkinson <andy.wilkinson>
Component: CatalinaAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: 9.0.x   
Target Milestone: -----   
Hardware: PC   
OS: All   

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