Buggy code:
@ , Writer writer ) throws IOException { } } @ Controller public static class BindingUriTemplateController { @ InitBinder public void initBinder ( WebDataBinder binder , @ PathVariable ( "hotel" ) String hotel ) { } @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller public static class NonBindingUriTemplateController { @ RequestMapping ( "//hotels//{hotel}//dates//{date}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable Date date , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//{hotel}" ) public static class RelativePathUriTemplateController { @ RequestMapping ( "bookings//{booking}" ) public void handle ( @ PathVariable ( "hotel" ) String hotel , @ PathVariable int booking , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class AmbiguousUriTemplateController { @ RequestMapping ( "//{hotel}" ) public void handleVars ( @ PathVariable ( "hotel" ) String hotel , Writer writer ) throws IOException { } @ RequestMapping ( "//new" ) public void handleSpecific ( Writer writer ) throws IOException { } @ RequestMapping ( "//*" ) public void handleWildCard ( Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels//*" ) public static class ExplicitSubPathController { @ RequestMapping ( "{hotel}" ) public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "hotels" ) public static class ImplicitSubPathController { @ RequestMapping ( "{hotel}" ) public void handleHotel ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller public static class CustomRegexController { @ RequestMapping ( "//{root:\\d+}" ) public void handle ( @ PathVariable ( "root" ) int root , Writer writer ) throws IOException { } } @ Controller public static class DoubleController { @ RequestMapping ( "//lat//{latitude}//long//{longitude}" ) public void testLatLong ( @ PathVariable Double latitude , @ PathVariable Double longitude , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "hotels" ) public static class CrudController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) throws IOException { } @ RequestMapping ( method = RequestMethod . POST ) public void create ( Writer writer ) throws IOException { } @ RequestMapping ( value = "//{hotel}" , method = RequestMethod . GET ) public void show ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . PUT ) public void createOrUpdate ( @ PathVariable String hotel , Writer writer ) throws IOException { } @ RequestMapping ( value = "{hotel}" , method = RequestMethod . DELETE ) public void remove ( @ PathVariable String hotel , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//hotels" ) public static class MethodNotAllowedController { @ RequestMapping ( method = RequestMethod . GET ) public void list ( Writer writer ) { } @ RequestMapping ( method = RequestMethod . GET , value = "{hotelId}" ) public void show ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . PUT , value = "{hotelId}" ) public void createOrUpdate ( @ PathVariable long hotelId , Writer writer ) { } @ RequestMapping ( method = RequestMethod . DELETE , value = "//{hotelId}" ) public void remove ( @ PathVariable long hotelId , Writer writer ) { } } @ Controller @ RequestMapping ( "//category" ) public static class MultiPathController { @ RequestMapping ( { "//{category}//page//{page}" , "//**//{category}//page//{page}" } ) public void category ( @ PathVariable String category , @ PathVariable int page , Writer writer ) throws IOException { } @ RequestMapping ( { "//{category}" , "//**//{category}" } ) public void category ( @ PathVariable String category , Writer writer ) throws IOException { } @ RequestMapping ( { "" } ) public void category ( Writer writer ) throws IOException { } @ RequestMapping ( { "//page//{page}" } ) public void category ( @ PathVariable int page , Writer writer ) throws IOException { } } @ RequestMapping ( "//*//menu//**" ) public static class MenuTreeController { @ RequestMapping ( "type//{var}" ) public void getFirstLevelFunctionNodes ( @ PathVariable ( "var" ) String var , Writer writer ) throws IOException { } } @ Controller @ RequestMapping ( "//test" ) public static class VariableNamesController { @ RequestMapping ( value = "//{foo}" , method = RequestMethod . GET ) public void foo ( @ PathVariable String foo , Writer writer ) throws IOException { } @ RequestMapping ( value = "//{bar}" , method = RequestMethod . DELETE ) public void bar ( @ PathVariable String bar , Writer writer ) throws IOException { } } @ Controller public static class Spr6978Controller { @ RequestMapping ( value = "//{type}//{id}" , method = RequestMethod . GET ) public void loadEntity ( @ PathVariable final String type , @ PathVariable final long id , Writer writer ) throws IOException { } @ RequestMapping ( value = "//module//{id}" , method = RequestMethod . GET ) public void loadModule ( @ PathVariable final long id , Writer writer ) throws IOException { } @ RequestMapping ( value = "//{type}//{id}" , method = RequestMethod . POST ) public void publish ( @ PathVariable final String type , @ PathVariable final long id , Writer writer ) throws IOException { } } private interface BeanDefinitionRegistrar { public void register ( GenericWebApplicationContext context ) { } } @ SuppressWarnings ( "serial" ) private void initDispatcherServlet ( final Class < ? > controllerClass , final UriTemplateServletHandlerMethodTests . BeanDefinitionRegistrar registrar ) throws ServletException { servlet = new DispatcherServlet ( ) { @ Override protected WebApplicationContext createWebApplicationContext ( WebApplicationContext parent ) { GenericWebApplicationContext wac = new GenericWebApplicationContext ( ) ; wac . registerBeanDefinition ( "controller" , new RootBeanDefinition ( controllerClass ) ) ; Class < ? > mappingType = RequestMappingHandlerMethodMapping . class ; wac . registerBeanDefinition ( "handlerMapping" , new RootBeanDefinition ( mappingType ) ) ; Class < ? > adapterType = RequestMappingHandlerMethodAdapter . class ; wac . registerBeanDefinition ( "handlerAdapter" , new RootBeanDefinition ( adapterType ) ) ; <START_BUG> Class < ? > resolverType = RequestMappingHandlerMethodExceptionResolver . class ; <END_BUG>

Fix:
Class < ? > resolverType = ExceptionHandlerExceptionResolver . class ;