1

我刚刚将我的一个项目从 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
4

0 回答 0