繁体   English   中英

Grails 2.4 spring-security-facebook:0.15.2-CORE2重定向错误-提交响应后无法调用sendError()

[英]Grails 2.4 spring-security-facebook:0.15.2-CORE2 redirect error - Cannot call sendError() after the response has been committed

我刚刚将我的一个项目从grails 2.3.5升级到2.4.2,并调整了所有插件(如下所示,在buildConfig中)以使其正常工作。

plugins {
    // plugins for the build system only
    build ":tomcat:7.0.54"
    // plugins for the compile step
    compile ":aws:1.6.7.5"
    compile ":console:1.3"
    compile ":mongodb:3.0.1"
    compile ":rest:0.8"
    compile ":scaffolding:2.1.2"
    compile ':spring-security-core:2.0-RC3'
    compile ":spring-security-ui:1.0-RC2"
    compile ':cache:1.1.7'

    // plugins needed at runtime but not for compilation
    // runtime ":hibernate:3.6.10.7" // or ":hibernate4:4.1.11.6"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"
    compile ":asset-pipeline:1.8.11"

    runtime ":pretty-time:0.3"
    runtime ":mail:1.0.6"

    compile "org.grails.plugins:spring-security-facebook:0.15.2-CORE2"
    compile ":grails-melody:1.49.0"
}

该项目运行正常,但facebook插件尚未运行。 我正在使用FacebookAuthRedirectFilter(默认设置)。 但是,当我单击视图上的连接按钮时,该请求被FacebookAuthRedirectFilter拦截,如预期那样,输入if语句,facebookAuthUtils完美地准备了该URL,但此后该视图应重定向到Facebook生成的URL。

if (uri.equals(redirectFromUrl)) {    
    response.sendRedirect(facebookAuthUtils.prepareRedirectUrl(getAbsoluteRedirectUrl(), facebookAuthUtils.requiredPermissions))
        return false
}

但是我收到以下错误:

2014-07-14 22:14:39,838 [http-bio-8080-exec-7] ERROR [/].[default]  - Servlet.service() for servlet [default] in context with path [] threw exception
Message: Cannot call sendError() after the response has been committed
Line | Method
->>   91 | sendError in net.bull.javamelody.FilterServletResponseWrapper
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    203 | doFilter  in net.bull.javamelody.MonitoringFilter
|    181 | doFilter  in     ''
|     53 | doFilter  in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
|     49 | doFilter  in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
|     82 | doFilter  in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker 
^    745 | run . . . in java.lang.Thread

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM