Buggy code:
registerSingleton ( "viewController" , ComplexPortletApplicationContext . ViewController . class ) ; registerSingleton ( "editController" , ComplexPortletApplicationContext . EditController . class ) ; registerSingleton ( "helpController1" , ComplexPortletApplicationContext . HelpController1 . class ) ; registerSingleton ( "helpController2" , ComplexPortletApplicationContext . HelpController2 . class ) ; registerSingleton ( "testController1" , ComplexPortletApplicationContext . TestController1 . class ) ; registerSingleton ( "testController2" , ComplexPortletApplicationContext . TestController2 . class ) ; registerSingleton ( "requestLocaleCheckingController" , ComplexPortletApplicationContext . RequestLocaleCheckingController . class ) ; registerSingleton ( "localeContextCheckingController" , ComplexPortletApplicationContext . LocaleContextCheckingController . class ) ; registerSingleton ( "exceptionThrowingHandler1" , ComplexPortletApplicationContext . ExceptionThrowingHandler . class ) ; registerSingleton ( "exceptionThrowingHandler2" , ComplexPortletApplicationContext . ExceptionThrowingHandler . class ) ; registerSingleton ( "unknownHandler" , Object . class ) ; registerSingleton ( "myPortlet" , ComplexPortletApplicationContext . MyPortlet . class ) ; registerSingleton ( "portletMultipartResolver" , ComplexPortletApplicationContext . MockMultipartResolver . class ) ; registerSingleton ( "portletPostProcessor" , SimplePortletPostProcessor . class ) ; registerSingleton ( "testListener" , ComplexPortletApplicationContext . TestApplicationListener . class ) ; ConstructorArgumentValues cvs = new ConstructorArgumentValues ( ) ; cvs . addIndexedArgumentValue ( 0 , new MockPortletContext ( ) ) ; cvs . addIndexedArgumentValue ( 1 , "complex" ) ; registerBeanDefinition ( "portletConfig" , new org . springframework . beans . factory . support . RootBeanDefinition ( MockPortletConfig . class , cvs , null ) ) ; UserRoleAuthorizationInterceptor userRoleInterceptor = new UserRoleAuthorizationInterceptor ( ) ; userRoleInterceptor . setAuthorizedRoles ( new String [ ] { "role1" , "role2" } ) ; ParameterHandlerMapping interceptingHandlerMapping = new ParameterHandlerMapping ( ) ; interceptingHandlerMapping . setParameterName ( "interceptingParam" ) ; ParameterMappingInterceptor parameterMappingInterceptor = new ParameterMappingInterceptor ( ) ; parameterMappingInterceptor . setParameterName ( "interceptingParam" ) ; List interceptors = new ArrayList ( ) ; interceptors . add ( parameterMappingInterceptor ) ; interceptors . add ( userRoleInterceptor ) ; interceptors . add ( new ComplexPortletApplicationContext . MyHandlerInterceptor1 ( ) ) ; interceptors . add ( new ComplexPortletApplicationContext . MyHandlerInterceptor2 ( ) ) ; MutablePropertyValues pvs = new MutablePropertyValues ( ) ; Map portletModeMap = new ManagedMap ( ) ; portletModeMap . put ( "view" , new RuntimeBeanReference ( "viewController" ) ) ; portletModeMap . put ( "edit" , new RuntimeBeanReference ( "editController" ) ) ; pvs . add ( "portletModeMap" , portletModeMap ) ; pvs . add ( "interceptors" , interceptors ) ; registerSingleton ( "handlerMapping3" , PortletModeHandlerMapping . class , pvs ) ; pvs = new MutablePropertyValues ( ) ; Map parameterMap = new ManagedMap ( ) ; parameterMap . put ( "test1" , new RuntimeBeanReference ( "testController1" ) ) ; parameterMap . put ( "test2" , new RuntimeBeanReference ( "testController2" ) ) ; parameterMap . put ( "requestLocaleChecker" , new RuntimeBeanReference ( "requestLocaleCheckingController" ) ) ; parameterMap . put ( "contextLocaleChecker" , new RuntimeBeanReference ( "localeContextCheckingController" ) ) ; parameterMap . put ( "exception1" , new RuntimeBeanReference ( "exceptionThrowingHandler1" ) ) ; parameterMap . put ( "exception2" , new RuntimeBeanReference ( "exceptionThrowingHandler2" ) ) ; parameterMap . put ( "myPortlet" , new RuntimeBeanReference ( "myPortlet" ) ) ; parameterMap . put ( "unknown" , new RuntimeBeanReference ( "unknownHandler" ) ) ; pvs . add ( "parameterMap" , parameterMap ) ; pvs . add ( "parameterName" , "myParam" ) ; pvs . add ( "order" , "2" ) ; registerSingleton ( "handlerMapping2" , ParameterHandlerMapping . class , pvs ) ; pvs = new MutablePropertyValues ( ) ; Map innerMap = new ManagedMap ( ) ; innerMap . put ( "help1" , new RuntimeBeanReference ( "helpController1" ) ) ; innerMap . put ( "help2" , new RuntimeBeanReference ( "helpController2" ) ) ; Map outerMap = new ManagedMap ( ) ; outerMap . put ( "help" , innerMap ) ; pvs . add ( "portletModeParameterMap" , outerMap ) ; pvs . add ( "order" , "1" ) ; registerSingleton ( "handlerMapping1" , PortletModeParameterHandlerMapping . class , pvs ) ; pvs = new MutablePropertyValues ( ) ; pvs . add ( "order" , "1" ) ; <START_BUG> pvs . add ( "exceptionMappings" , ( "java.lang.IllegalAccessException=failed-illegalaccess\n" + ( "PortletRequestBindingException=failed-binding\n" + "UnavailableException=failed-unavailable" ) ) ) ; <END_BUG> pvs . add ( "defaultErrorView" , "failed-default-1" ) ; registerSingleton ( "exceptionResolver" , SimpleMappingExceptionResolver . class , pvs ) ; pvs = new MutablePropertyValues ( ) ; pvs . add ( "order" , "0" ) ; pvs . add ( "exceptionMappings" , ( "java.lang.Exception=failed-exception\n" + "java.lang.RuntimeException=failed-runtime" ) ) ; List mappedHandlers = new ManagedList ( ) ; mappedHandlers . add ( new RuntimeBeanReference ( "exceptionThrowingHandler1" ) ) ; pvs . add ( "mappedHandlers" , mappedHandlers ) ; pvs . add ( "defaultErrorView" , "failed-default-0" ) ; registerSingleton ( "handlerExceptionResolver" , SimpleMappingExceptionResolver . class , pvs ) ; addMessage ( "test" , Locale . ENGLISH , "test<seq2seq4repair_space>message" ) ; addMessage ( "test" , Locale . CANADA , "Canadian<seq2seq4repair_space>&<seq2seq4repair_space>test<seq2seq4repair_space>message" ) ; addMessage ( "test.args" , Locale . ENGLISH , "test<seq2seq4repair_space>{0}<seq2seq4repair_space>and<seq2seq4repair_space>{1}" ) ; super . refresh ( ) ; } public static class TestController1 implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { } public ModelAndView handleRenderRequest ( RenderRequest request , RenderResponse response ) throws Exception { } } public static class TestController2 implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { } public ModelAndView handleRenderRequest ( RenderRequest request , RenderResponse response ) throws Exception { } } public static class ViewController implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { } public ModelAndView handleRenderRequest ( RenderRequest request , RenderResponse response ) throws Exception { } } public static class EditController implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { } public ModelAndView handleRenderRequest ( RenderRequest request , RenderResponse response ) throws Exception { } } public static class HelpController1 implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { } public ModelAndView handleRenderRequest ( RenderRequest request , RenderResponse response ) throws Exception { } } public static class HelpController2 implements Controller { public void handleActionRequest ( ActionRequest request , ActionResponse response ) { }

Fix:
pvs . add ( "exceptionMappings" , ( "java.lang.IllegalAccessException=failed-illegalaccess\n" + ( "PortletRequestBindingException=failed-binding\n" + "NoHandlerFoundException=failed-unavailable" ) ) ) ;