Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring MVC - Annotation based controller failed to find request handler method
    text
    copied!<p>This has stopped working after I added a Spring Security filter.</p> <p>Spring 3.1.4.RELEASE <BR> Spring Security 3.1.2.RELEASE <BR> Tomcat 7.0.37</p> <p>The mapping is configured as expected when the app is deployed</p> <pre> INFO annotation.RequestMappingHandlerMapping: Mapped "{[/countries],methods=[GET],params=[!countryCode],headers=[],consumes=[],produces=[application/json],custom=[]}" onto public com.purpleleaf.proxy.rest.data.ProxyResponse com.purpleleaf.proxy.rest.service.reference.DefaultCountry.findAll() </pre> <p>The GET request is submitted.</p> <pre> GET http://localhost:8081/purpleleaf-admin-1.0.0/countries?page=1&start=0&limit=25 </pre> <p>The request parameters are added by ExtJS and it is not an issue as it was working without security.</p> <p>The log for the GET request</p> <pre> DEBUG util.AntPathRequestMatcher: Checking match of request : '/countries'; against '/*' DEBUG web.FilterChainProxy: /countries?page=1&start=0&limit=25 has an empty filter list DEBUG servlet.DispatcherServlet: DispatcherServlet with name 'admin-spring' processing GET request for [//purpleleaf-admin-1.0.0/countries] DEBUG annotation.RequestMappingHandlerMapping: Looking up handler method for path //purpleleaf-admin-1.0.0/countries DEBUG annotation.RequestMappingHandlerMapping: Did not find handler method for [//purpleleaf-admin-1.0.0/countries] DEBUG handler.SimpleUrlHandlerMapping: Matching patterns for request [//purpleleaf-admin-1.0.0/countries] are [/**] DEBUG handler.SimpleUrlHandlerMapping: URI Template variables for request [//purpleleaf-admin-1.0.0/countries] are {} DEBUG handler.SimpleUrlHandlerMapping: Mapping [//purpleleaf-admin-1.0.0/countries] to HandlerExecutionChain with handler [org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler@3f8050cf] and 1 interceptor DEBUG servlet.DispatcherServlet: Last-Modified value for [//purpleleaf-admin-1.0.0/countries] is: -1 DEBUG servlet.DispatcherServlet: Null ModelAndView returned to DispatcherServlet with name 'admin-spring': assuming HandlerAdapter completed request handling DEBUG servlet.DispatcherServlet: Successfully completed request </pre> <p>When the request is processed by web.filterChainProxy it is <strong>/countries</strong> but when it is process by annotation.RequestMappingHandlerMapping it is <strong>//purpleleaf-admin-1.0.0/countires</strong></p> <p><strong>purpleleaf-admin-1.0.0</strong> is the folder where war file is unpaked.</p> <p>web.xml has following servlet and filter mapping</p> <pre><code>&lt;servlet-mapping&gt; &lt;servlet-name&gt;admin-spring&lt;/servlet-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; </code></pre> <p>Any suggestion on how I can resolve this mapping?</p> <p>Edit 1: Spring Security Configuration File</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt; &lt;beans:import resource="classpath*:applicationContext-CrowdClient.xml" /&gt; &lt;beans:bean id="crowdUserDetailsService" class="com.atlassian.crowd.integration.springsecurity.user.CrowdUserDetailsServiceImpl"&gt; &lt;beans:property name="authenticationManager" ref="crowdAuthenticationManager"/&gt; &lt;beans:property name="groupMembershipManager" ref="crowdGroupMembershipManager"/&gt; &lt;beans:property name="userManager" ref="crowdUserManager"/&gt; &lt;beans:property name="authorityPrefix" value="ROLE_"/&gt; &lt;/beans:bean&gt; &lt;beans:bean id="crowdAuthenticationProvider" class="com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProvider"&gt; &lt;beans:constructor-arg ref="crowdAuthenticationManager"/&gt; &lt;beans:constructor-arg ref="httpAuthenticator"/&gt; &lt;beans:constructor-arg ref="crowdUserDetailsService"/&gt; &lt;/beans:bean&gt; &lt;authentication-manager alias="authenticationManager"&gt; &lt;authentication-provider ref='crowdAuthenticationProvider' /&gt; &lt;/authentication-manager&gt; &lt;beans:bean id="crowdAuthenticationProcessingFilterEntryPoint" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"&gt; &lt;beans:constructor-arg value="/login.jsp" /&gt; &lt;/beans:bean&gt; &lt;beans:bean id="crowdAuthenticationProcessingFilter" class="com.atlassian.crowd.integration.springsecurity.CrowdSSOAuthenticationProcessingFilter"&gt; &lt;beans:property name="httpAuthenticator" ref="httpAuthenticator"/&gt; &lt;beans:property name="authenticationManager" ref="authenticationManager"/&gt; &lt;beans:property name="filterProcessesUrl" value="/j_security_check"/&gt; &lt;beans:property name="authenticationFailureHandler"&gt; &lt;beans:bean class="com.atlassian.crowd.integration.springsecurity.UsernameStoringAuthenticationFailureHandler"&gt; &lt;beans:property name="defaultFailureUrl" value="/login.jsp?error=true"/&gt; &lt;/beans:bean&gt; &lt;/beans:property&gt; &lt;beans:property name="authenticationSuccessHandler"&gt; &lt;beans:bean class="org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler"&gt; &lt;beans:property name="defaultTargetUrl" value="/"/&gt; &lt;/beans:bean&gt; &lt;/beans:property&gt; &lt;/beans:bean&gt; &lt;beans:bean id="crowdLogoutHandler" class="com.atlassian.crowd.integration.springsecurity.CrowdLogoutHandler"&gt; &lt;beans:property name="httpAuthenticator" ref="httpAuthenticator"/&gt; &lt;/beans:bean&gt; &lt;beans:bean id="securityContextLogoutHandler" class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" /&gt; &lt;beans:bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"&gt; &lt;beans:constructor-arg index="0" value="/index.html"/&gt; &lt;beans:constructor-arg index="1"&gt; &lt;beans:list&gt; &lt;beans:ref bean="crowdLogoutHandler"/&gt; &lt;beans:ref bean="securityContextLogoutHandler"/&gt; &lt;/beans:list&gt; &lt;/beans:constructor-arg&gt; &lt;beans:property name="filterProcessesUrl" value="/logout.html"/&gt; &lt;/beans:bean&gt; &lt;http pattern='/*' security='none'/&gt; &lt;!--http pattern='/scripts/*' security='none'/--&gt; &lt;http auto-config="false" entry-point-ref="crowdAuthenticationProcessingFilterEntryPoint"&gt; &lt;custom-filter position="FORM_LOGIN_FILTER" ref='crowdAuthenticationProcessingFilter'/&gt; &lt;custom-filter position="LOGOUT_FILTER" ref='logoutFilter'/&gt; &lt;!--intercept-url pattern="/admin/*" access="ROLE_application-administrators"/--&gt; &lt;!--intercept-url pattern="/passwordHint.html" access="ROLE_ANONYMOUS,ROLE_ADMIN,ROLE_USER"/--&gt; &lt;!--security:intercept-url pattern="/**/*.html*" access="IS_AUTHENTICATED_FULLY"/--&gt; &lt;/http&gt; &lt;/beans:beans&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload