使用Spring Boot OAuth2在AWS部署的应用程序上不允许使用405方法

时间:2015-05-03 00:41:41

标签: java spring security amazon-web-services oauth-2.0

我有一个应用程序,直到昨天在本地和AWS上运行良好。突然,在AWS部署的代码版本上调用/ oauth / token时,应用程序无法正常工作 - 而本地应用程序运行良好而没有错误。本地和基于AWS的应用程序一直运行AOK直到星期五 - 并且在星期五和之前的部署(星期四)之间没有发生重大代码更改。我完全重建了AWS环境,认为它是一个环境问题,但这并没有解决问题。

问题:当使用(先前)有效格式化的POST请求调用/ oauth / token时,我收到405方法不允许。

到目前为止我发现的内容如下:

Key Jars是Spring Boot 1.2.3.RELEASE,Spring OAuth2 2.0.7.RELEEASE在Tomcat 8 / Java 8 Elasticbeanstalk中运行。

通过JSON调用/ oauth / token时收到的错误:

405
Allow = "HEAD, GET";
"Cache-Control" = "no-cache, no-store, max-age=0, must-revalidate";
Connection = close;
"Content-Type" = "application/json;charset=UTF-8";
Date = "Sun, 03 May 2015 00:13:00 GMT";
Expires = 0;
Pragma = "no-cache";
Server = "Apache-Coyote/1.1";
"Transfer-Encoding" = Identity;
"X-Content-Type-Options" = nosniff;
"X-Frame-Options" = DENY;
"X-XSS-Protection" = "1; mode=block";
{"timestamp":1430611980,"status":405,"error":"Method Not Allowed","exception":"org.springframework.web.HttpRequestMethodNotSupportedException","message":"Request method 'POST' not supported"}

应用程序启动日志与Spring TokenEndpoint的映射相关,以处理/ oauth / * url路径。特别是/ oauth / token似乎正确映射到POST:

2015-05-03 00:11:52.718  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/authorize],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint.authorize(java.util.Map<java.lang.String, java.lang.Object>,java.util.Map<java.lang.String, java.lang.String>,org.springframework.web.bind.support.SessionStatus,java.security.Principal)
2015-05-03 00:11:52.718 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=AE#authorize
2015-05-03 00:11:52.718  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/authorize],methods=[POST],params=[user_oauth_approval],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.View org.springframework.security.oauth2.provider.endpoint.AuthorizationEndpoint.approveOrDeny(java.util.Map<java.lang.String, java.lang.String>,java.util.Map<java.lang.String, ?>,org.springframework.web.bind.support.SessionStatus,java.security.Principal)
2015-05-03 00:11:52.718 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=AE#approveOrDeny
2015-05-03 00:11:52.720  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/token],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<org.springframework.security.oauth2.common.OAuth2AccessToken> org.springframework.security.oauth2.provider.endpoint.TokenEndpoint.getAccessToken(java.security.Principal,java.util.Map<java.lang.String, java.lang.String>) throws org.springframework.web.HttpRequestMethodNotSupportedException
2015-05-03 00:11:52.720 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=TE#getAccessToken
2015-05-03 00:11:52.720  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/token],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.http.ResponseEntity<org.springframework.security.oauth2.common.OAuth2AccessToken> org.springframework.security.oauth2.provider.endpoint.TokenEndpoint.postAccessToken(java.security.Principal,java.util.Map<java.lang.String, java.lang.String>) throws org.springframework.web.HttpRequestMethodNotSupportedException
2015-05-03 00:11:52.720 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=TE#postAccessToken
2015-05-03 00:11:52.721  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/check_token],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.util.Map<java.lang.String, ?> org.springframework.security.oauth2.provider.endpoint.CheckTokenEndpoint.checkToken(java.lang.String)
2015-05-03 00:11:52.721 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=CTE#checkToken
2015-05-03 00:11:52.721  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/confirm_access],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.security.oauth2.provider.endpoint.WhitelabelApprovalEndpoint.getAccessConfirmation(java.util.Map<java.lang.String, java.lang.Object>,javax.servlet.http.HttpServletRequest) throws java.lang.Exception
2015-05-03 00:11:52.721 TRACE --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapping name=WAE#getAccessConfirmation
2015-05-03 00:11:52.722  INFO --- [ost-startStop-1] .s.o.p.e.FrameworkEndpointHandlerMapping : Mapped "{[/oauth/error],methods=[],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.security.oauth2.provider.endpoint.WhitelabelErrorEndpoint.handleError(javax.servlet.http.HttpServletRequest)

最后,/ oauth / token URL正在处理请求(启用跟踪):

2015-05-03 00:13:00.159 TRACE --- [nio-8080-exec-2] o.s.b.a.trace.WebRequestTraceFilter      : Processing request POST /oauth/token
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/css/**'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/js/**'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/images/**'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/**/favicon.ico'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/error'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher  : Trying to match using Ant [pattern='/oauth/token']
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/oauth/token'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.s.web.util.matcher.OrRequestMatcher  : matched
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 1 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
2015-05-03 00:13:00.159 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 2 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
2015-05-03 00:13:00.160 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 3 of 11 in additional filter chain; firing Filter: 'HeaderWriterFilter'
2015-05-03 00:13:00.160 DEBUG --- [nio-8080-exec-2] o.s.s.w.header.writers.HstsHeaderWriter  : Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@239f5596
2015-05-03 00:13:00.160 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 4 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
2015-05-03 00:13:00.160 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/logout'
2015-05-03 00:13:00.160 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
2015-05-03 00:13:00.162 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.www.BasicAuthenticationFilter  : Basic Authentication Authorization header found for user 'wander-ios'
2015-05-03 00:13:00.163 DEBUG --- [nio-8080-exec-2] o.s.s.authentication.ProviderManager     : Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
2015-05-03 00:13:00.166 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Creating shared instance of singleton bean 'scopedTarget.clientDetailsService'
2015-05-03 00:13:00.166 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Creating instance of bean 'scopedTarget.clientDetailsService'
2015-05-03 00:13:00.166 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'metaDataSourceAdvisor'
2015-05-03 00:13:00.166 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'org.springframework.security.oauth2.config.annotation.configuration.ClientDetailsServiceConfiguration'
2015-05-03 00:13:00.169 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Eagerly caching bean 'scopedTarget.clientDetailsService' to allow for resolving potential circular references
2015-05-03 00:13:00.170 TRACE --- [nio-8080-exec-2] o.s.beans.CachedIntrospectionResults     : Getting BeanInfo for class [org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService]
2015-05-03 00:13:00.172 TRACE --- [nio-8080-exec-2] o.s.beans.CachedIntrospectionResults     : Caching PropertyDescriptors for class [org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService]
2015-05-03 00:13:00.172 TRACE --- [nio-8080-exec-2] o.s.beans.CachedIntrospectionResults     : Found bean property 'class' of type [java.lang.Class]
2015-05-03 00:13:00.172 TRACE --- [nio-8080-exec-2] o.s.beans.CachedIntrospectionResults     : Found bean property 'clientDetailsStore' of type [java.util.Map]
2015-05-03 00:13:00.172 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'metaDataSourceAdvisor'
2015-05-03 00:13:00.173 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'metaDataSourceAdvisor'
2015-05-03 00:13:00.173 DEBUG --- [nio-8080-exec-2] s.a.ScheduledAnnotationBeanPostProcessor : No @Scheduled annotations found on bean class: class org.springframework.security.oauth2.provider.client.InMemoryClientDetailsService
2015-05-03 00:13:00.173 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Finished creating instance of bean 'scopedTarget.clientDetailsService'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.www.BasicAuthenticationFilter  : Authentication success: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bb5fd4d6: Principal: org.springframework.security.core.userdetails.User@bb780ced: Username: wander-ios; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 146.200.167.251; SessionId: null; Granted Authorities: USER
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.AnonymousAuthenticationFilter  : SecurityContextHolder not populated with anonymous token, as it already contained: 'org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bb5fd4d6: Principal: org.springframework.security.core.userdetails.User@bb780ced: Username: wander-ios; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 146.200.167.251; SessionId: null; Granted Authorities: USER'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] s.CompositeSessionAuthenticationStrategy : Delegating to org.springframework.security.web.authentication.session.ChangeSessionIdAuthenticationStrategy@66207ac
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/oauth/token'; against '/oauth/token'
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor    : Secure object: FilterInvocation: URL: /oauth/token; Attributes: [fullyAuthenticated]
2015-05-03 00:13:00.178 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor    : Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bb5fd4d6: Principal: org.springframework.security.core.userdetails.User@bb780ced: Username: wander-ios; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: USER; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffffc434: RemoteIpAddress: 146.200.167.251; SessionId: null; Granted Authorities: USER
2015-05-03 00:13:00.179 DEBUG --- [nio-8080-exec-2] o.s.s.access.vote.AffirmativeBased       : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@110d157f, returned: 1
2015-05-03 00:13:00.179 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor    : Authorization successful
2015-05-03 00:13:00.179 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.i.FilterSecurityInterceptor    : RunAsManager did not change Authentication object
2015-05-03 00:13:00.179 DEBUG --- [nio-8080-exec-2] o.s.security.web.FilterChainProxy        : /oauth/token reached end of additional filter chain; proceeding with original chain
2015-05-03 00:13:00.180 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'managementServerProperties'
2015-05-03 00:13:00.182 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Bound request context to thread: SecurityContextHolderAwareRequestWrapper[ FirewalledRequest[ org.apache.catalina.connector.RequestFacade@62ea2082]]
2015-05-03 00:13:00.182 DEBUG --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : DispatcherServlet with name 'dispatcherServlet' processing POST request for [/oauth/token]
2015-05-03 00:13:00.183 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@3d4e9921] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.184 TRACE --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : No handler mapping found for [/oauth/token]
2015-05-03 00:13:00.184 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerMapping@282c7c01] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.184 DEBUG --- [nio-8080-exec-2] o.s.b.a.e.mvc.EndpointHandlerMapping     : Looking up handler method for path /oauth/token
2015-05-03 00:13:00.185 DEBUG --- [nio-8080-exec-2] o.s.b.a.e.mvc.EndpointHandlerMapping     : Did not find handler method for [/oauth/token]
2015-05-03 00:13:00.185 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping@61e27fb4] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.185 DEBUG --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /oauth/token
2015-05-03 00:13:00.190 DEBUG --- [nio-8080-exec-2] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/oauth/token]
2015-05-03 00:13:00.190 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.integration.http.inbound.IntegrationRequestMappingHandlerMapping@6dfb9823] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.190 DEBUG --- [nio-8080-exec-2] .IntegrationRequestMappingHandlerMapping : Looking up handler method for path /oauth/token
2015-05-03 00:13:00.190 DEBUG --- [nio-8080-exec-2] .IntegrationRequestMappingHandlerMapping : Did not find handler method for [/oauth/token]
2015-05-03 00:13:00.190 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping@75e4e122] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.190 TRACE --- [nio-8080-exec-2] o.s.w.s.h.BeanNameUrlHandlerMapping      : No handler mapping found for [/oauth/token]
2015-05-03 00:13:00.190 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler map [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@78db6873] in DispatcherServlet with name 'dispatcherServlet'
2015-05-03 00:13:00.190 DEBUG --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : Matching patterns for request [/oauth/token] are [/**]
2015-05-03 00:13:00.191 DEBUG --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : URI Template variables for request [/oauth/token] are {}
2015-05-03 00:13:00.196 DEBUG --- [nio-8080-exec-2] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapping [/oauth/token] to HandlerExecutionChain with handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@2e34820]]] and 1 interceptor
2015-05-03 00:13:00.197 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler adapter [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter@604e4ed1]
2015-05-03 00:13:00.197 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Testing handler adapter [org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@331deeee]
2015-05-03 00:13:00.199 DEBUG --- [nio-8080-exec-2] .w.s.m.a.ResponseStatusExceptionResolver : Resolving exception from handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@2e34820]]]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
2015-05-03 00:13:00.199 DEBUG --- [nio-8080-exec-2] .w.s.m.s.DefaultHandlerExceptionResolver : Resolving exception from handler [ResourceHttpRequestHandler [locations=[ServletContext resource [/], class path resource [META-INF/resources/], class path resource [resources/], class path resource [static/], class path resource [public/]], resolvers=[org.springframework.web.servlet.resource.PathResourceResolver@2e34820]]]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
2015-05-03 00:13:00.200  WARN --- [nio-8080-exec-2] o.s.web.servlet.PageNotFound             : Request method 'POST' not supported
2015-05-03 00:13:00.200 DEBUG --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
2015-05-03 00:13:00.201 TRACE --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Cleared thread-bound request context: SecurityContextHolderAwareRequestWrapper[ FirewalledRequest[ org.apache.catalina.connector.RequestFacade@62ea2082]]
2015-05-03 00:13:00.201 DEBUG --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet        : Successfully completed request
2015-05-03 00:13:00.201 TRACE --- [nio-8080-exec-2] ationConfigEmbeddedWebApplicationContext : Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@58945a18: ServletRequestHandledEvent: url=[/oauth/token]; client=[146.200.167.251]; method=[POST]; servlet=[dispatcherServlet]; session=[null]; user=[wander-ios]; time=[20ms]; status=[OK]
2015-05-03 00:13:00.201 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'delegatingApplicationListener'
2015-05-03 00:13:00.201 DEBUG --- [nio-8080-exec-2] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean 'org.springframework.integration.internalMessagingAnnotationPostProcessor'
2015-05-03 00:13:00.202 DEBUG --- [nio-8080-exec-2] o.s.s.w.a.ExceptionTranslationFilter     : Chain processed normally
2015-05-03 00:13:00.202 DEBUG --- [nio-8080-exec-2] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

我不能为我的生活弄清楚为什么请求由资源servlet而不是TokenEndpoint处理。任何线索都赞赏!

0 个答案:

没有答案