We had a config working on 6.0.18 and failing in 6.0.20. In tomcat log, we found the following NPE at initialization: Jun 4, 2009 5:15:25 PM org.apache.catalina.connector.MapperListener init WARNING: Error registering contexts Throwable occurred: java.lang.NullPointerException at org.apache.catalina.connector.MapperListener.registerHost(MapperListener.java:332) at org.apache.catalina.connector.MapperListener.init(MapperListener.java:129) at org.apache.catalina.connector.Connector.start(Connector.java:1146) at org.apache.catalina.core.StandardService.start(StandardService.java:531) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:583) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:612) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Following this error, server keeps on starting and is correctly listening on its connector port as expected. Any call to a JSP, static ressource will keep on returning a 400 status code. Further testes were conducted and we found that in server.xml service name (<Service name="xxx") and engine name (<Engine name="xxx") have to match. If they don't, you get the NPE error and 400 status code. If they match, no NPE and no 400 errors.
That looks to be a side effect of the fix for 42707. Having the names the same won't cause any problems. In fact it helps make sure JMX works as expected. As has been said previously, we really need to combine service and engine. That is too big a change for 6.0.x but we should be able to do it for 7. For 6.0.x, the best we can do is add something to the docs.
Actually, you can fix it by removing the use of ServerFactory, and get the engine through the connector.
Created attachment 23764 [details] Proposed patch to fix this issue Given it was me who removed ServerFactory from trunk, you'd think I would have figured that out. Thanks for the tip. Patch attached.
This has been fixed in trunk and will be in 6.0.21
Reopening. This issue is reproducible in tc5.5.x. The fix is already proposed there.
Fix in 5.5.x and will be in 5.5.28 onwards.