Facebook Connect插件和Grails问题

时间:2011-05-23 21:02:16

标签: grails facebook grails-plugin

不确定如何开始解决此问题。我按照此页面上的确切说明进行操作 - http://www.grails.org/Facebook+Connect+Plugin 此页面上的说明是否正确?还是遗失了什么? 这个插件是否因其他原因而被抛弃?不确定Spring Social在哪里适合这个,或者甚至是生产就绪。

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 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 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:

更多信息: Groovy版本:1.7.5 JVM:1.6.0_22
Grails 1.3.7 其他人可以用插件复制这个问题吗?和示例代码?

2 个答案:

答案 0 :(得分:2)

这似乎是插件中的一个错误。我现在面临同样的问题。这是一个临时工作: 转到FacebookConnectService并修改afterPropertiesSet()方法,如下所示:

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) 
    }
}

答案 1 :(得分:0)

首先,

从错误输出中,您似乎错过了标记末尾的反斜杠 /

<g:facebookConnectJavascript  />

从那里开始..并发布结果。