开发者

Facebook Connect Plugin and Grails Issue

Not sure how to begin troubleshooting this issue. I followed the exact instructions on this page - http://www.grails.org/Facebook+Connect+Plugin Are the instructions on this page correct? or missing something? Is this plugin abandoned for something else? Not sure where Spring Social fits into this, or if that is even production-ready.

Error 500: Error processing GroovyPageView: Error executing tag <g:facebookConnectJavascript>: Error creating bean with name 'FacebookTagLib': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean wi开发者_如何转开发th name 'facebookConnectService': Invocation of init method failed; nested exception is java.lang.ClassNotFoundException: FacebookConnectConfig at P:/testapp/grails-app/views/loginFacebook/auth.gsp:15 Servlet: grails URI: /lmfirst/grails/loginFacebook/auth.dispatch Exception Message: FacebookConnectConfig Caused by: Error processing GroovyPageView: Error executing tag <g:facebookConnectJavascript>: Error creating bean with name 'FacebookTagLib': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'facebookConnectService': Invocation of init method failed; nested exception is java.lang.ClassNotFoundException: FacebookConnectConfig at P:/testapp/grails-app/views/loginFacebook/auth.gsp:15 Class: FacebookConnectService At Line: [15] Code Snippet:

MORE INFORMATION: Groovy Version: 1.7.5 JVM: 1.6.0_22

Grails 1.3.7 Can anyone else replicate this issue with the plugin? and the example code?


This appears to be a bug in the plugin. I faced the same problem now. This is a temporary work around: Go to FacebookConnectService and modify the afterPropertiesSet() method like this:

void afterPropertiesSet() {
    def config
    try {
        config = Class.forName("FacebookConnectConfig").newInstance()
        facebookConnectConfig = new ConfigSlurper().parse(config.getClass()) 
    } catch(ClassNotFoundException e) { 
        // no compiled class exists for the config, we must be running the Grails built-in web server 
        GroovyClassLoader loader = new GroovyClassLoader(getClass().getClassLoader()) 
        Class clazz = loader.parseClass(new File("grails-app/conf/FacebookConnectConfig.groovy")) 
        facebookConnectConfig = new ConfigSlurper().parse(clazz) 
    }
}


Firstly,

From the error output it seems you're missing the back slash / at the end of the tag.

<g:facebookConnectJavascript  />

Start there.. and post the results.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜