If the Server part of the Tomcat 6 configuration is beeing processed and there are more connectory defined, it seems to be the fact the exceptions during the connector initialization are not catched properly, so if there comes some exception by the initialization of one connector (for example to try to initialize the new connector for the same port like had the already initialized connector), then no other connectors are processed and created (no one listening port is allocated) even if such other connectors are defined properly. It leads to the situation the connectory are then initialized differently if the order of the connectors changes. It can be very confusing if searching some error in the definitions. Together with the fact, the default server.xml contains at least in some cases the invalid connector definition it leads to serious confusion it searching the configuration problem...
It is then the problem especially in the connection with the bug 49031
This has been fixed in trunk and proposed for 6.0.x
Great, thank You.
I like this, but there are caveats implementing this feature: 1. Connectors that fail in a call to initialize() will also likely to fail in start(), pause(), stop(). Thus all the loops over connectors have to be safeguarded. This includes loops over array returned by StandardService.findConnectors(), e.g. in ServerLifecycleListener#destroyMBeans(Service). 2. Need to reimplement support for org.apache.catalina.startup.EXIT_ON_INIT_FAILURE=true configuration property [1], [2]. [1] http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html [2] https://issues.apache.org/bugzilla/show_bug.cgi?id=48625 As a test case for this feature one can try to start a second instance of Tomcat using the same configuration. If the above EXIT_ON_INIT_FAILURE setting is added to conf/catalina.properties, Tomcat 6.0.27 will abort startup on the first init() failure. If the init() exception were caught and startup continued, as proposed patch does, the abort does not happen.
Created attachment 25633 [details] 2010-06-24_tc6_bug49030.patch Patch for tc6.0.x
I ported the patch to TC7 and applied in r957960, but my testing shows that the fix for bug 48625 included there does not work, because Connector.init() does not behave as expected. I created bug 49503 to track that.
This has been fixed in 6.0.x and will be included in 6.0.30 onwards.
*** Bug 46461 has been marked as a duplicate of this bug. ***