New feature based on discussion: http://markmail.org/message/3nczqiqm6smez255
Created attachment 27861 [details] v1 patch for discussion I have started to look at this and it looks doable. port=0 works for all connectors for 64-bit Windows. The problem is with MBean names, JMX MBean registration and logging info. The port number is not available at the point where the JMX registration occurs. If bindOnInit="false", the port number may change multiple times during the life of the connector. With multiple connectors using port="0" there will be a naming clash as the connectors need to be registered before the the ports are known. I see two options. 1. Use auto-1, auto-2 instead of the port number in the JMX names (with a static, thread-safe counter). 2. Re-register the connector and related components when the port number changes. I'm leaning towards one as it is a heck of a lot simpler. Thoughts?
This has been fixed in trunk and back-ported to 7.0.x. It will be included in 7.0.24 onwards.
Backported to Tomcat 6 (r1723545, r1723551) and will be in 6.0.45 onwards.