Настройка плагина shiro-oauth в Grails

Я использую плагин shiro-oauth в Grails. Я настроил плагин следующим образом

    oauth {
    providers {
        facebook {
            provider = org.scribe.builder.api.FacebookApi
            key = 'zuckerberg'
            secret = 'brothers'
            callback = "${grails.serverURL}/auth/callback"
            successUri = "/oauth/OnSuccess?provider=facebook"
            failureUri = "${grails.serverURL}/auth/unauthorized"
        }

    }
    debug = true
}

но после запуска приложения я получил эту ошибку следующим образом

Class: uk.co.desirableobjects.oauth.scribe.exception.InvalidOauthProviderException
Message
[:] is not a Class

и трассировка стека выглядит следующим образом

 Line | Method
->>  116 | logThrowable     in AbstractFilter.java
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|     70 | doFilter         in     ''
|     55 | doFilter . . . . in SavedRequestFilter.java
|    449 | executeChain     in org.apache.shiro.web.servlet.AbstractShiroFilter
|    365 | call . . . . . . in org.apache.shiro.web.servlet.AbstractShiroFilter$1
|     90 | doCall           in org.apache.shiro.subject.support.SubjectCallable
|     83 | call . . . . . . in     ''
|    380 | execute          in org.apache.shiro.subject.support.DelegatingSubject
|    362 | doFilterInternal in org.apache.shiro.web.servlet.AbstractShiroFilter
|    125 | doFilter         in org.apache.shiro.web.servlet.OncePerRequestFilter
|   1145 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . .  in java.lang.Thread

Caused by BeanCreationException: Error creating bean with name 'uk.co.desirableobjects.oauth.scribe.OauthController': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthController]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauthService': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthService]: Constructor threw exception; nested exception is uk.co.desirableobjects.oauth.scribe.exception.InvalidOauthProviderException: [:] is not a Class
->>  196 | getBean          in AbstractFilter.java
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    842 | lookupController in PageFragmentCachingFilter.java
|    176 | doFilter . . . . in     ''
|     63 | doFilter         in AbstractFilter.java
|     55 | doFilter . . . . in SavedRequestFilter.java
|    449 | executeChain     in org.apache.shiro.web.servlet.AbstractShiroFilter
|    365 | call . . . . . . in org.apache.shiro.web.servlet.AbstractShiroFilter$1
|     90 | doCall           in org.apache.shiro.subject.support.SubjectCallable
|     83 | call . . . . . . in     ''
|    380 | execute          in org.apache.shiro.subject.support.DelegatingSubject
|    362 | doFilterInternal in org.apache.shiro.web.servlet.AbstractShiroFilter
|    125 | doFilter         in org.apache.shiro.web.servlet.OncePerRequestFilter
|   1145 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . .  in java.lang.Thread

Caused by BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthController]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'oauthService': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthService]: Constructor threw exception; nested exception is uk.co.desirableobjects.oauth.scribe.exception.InvalidOauthProviderException: [:] is not a Class
->>  196 | getBean          in AbstractFilter.java
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    842 | lookupController in PageFragmentCachingFilter.java
|    176 | doFilter . . . . in     ''
|     63 | doFilter         in AbstractFilter.java
|     55 | doFilter . . . . in SavedRequestFilter.java
|    449 | executeChain     in org.apache.shiro.web.servlet.AbstractShiroFilter
|    365 | call . . . . . . in org.apache.shiro.web.servlet.AbstractShiroFilter$1
|     90 | doCall           in org.apache.shiro.subject.support.SubjectCallable
|     83 | call . . . . . . in     ''
|    380 | execute          in org.apache.shiro.subject.support.DelegatingSubject
|    362 | doFilterInternal in org.apache.shiro.web.servlet.AbstractShiroFilter
|    125 | doFilter         in org.apache.shiro.web.servlet.OncePerRequestFilter
|   1145 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . .  in java.lang.Thread

Caused by BeanCreationException: Error creating bean with name 'oauthService': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthService]: Constructor threw exception; nested exception is uk.co.desirableobjects.oauth.scribe.exception.InvalidOauthProviderException: [:] is not a Class
->>  196 | getBean          in AbstractFilter.java
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    842 | lookupController in PageFragmentCachingFilter.java
|    176 | doFilter . . . . in     ''
|     63 | doFilter         in AbstractFilter.java
|     55 | doFilter . . . . in SavedRequestFilter.java
|    449 | executeChain     in org.apache.shiro.web.servlet.AbstractShiroFilter
|    365 | call . . . . . . in org.apache.shiro.web.servlet.AbstractShiroFilter$1
|     90 | doCall           in org.apache.shiro.subject.support.SubjectCallable
|     83 | call . . . . . . in     ''
|    380 | execute          in org.apache.shiro.subject.support.DelegatingSubject
|    362 | doFilterInternal in org.apache.shiro.web.servlet.AbstractShiroFilter
|    125 | doFilter         in org.apache.shiro.web.servlet.OncePerRequestFilter
|   1145 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . . . .  in java.lang.Thread

Caused by BeanInstantiationException: Could not instantiate bean class [uk.co.desirableobjects.oauth.scribe.OauthService]: Constructor threw exception; nested exception is uk.co.desirableobjects.oauth.scribe.exception.InvalidOauthProviderException: [:] is not a Class
->>  196 | getBean          in AbstractFilter.java
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 


Caused by InvalidOauthProviderException: [:] is not a Class

Может кто-нибудь сказать мне, где я ошибаюсь при настройке файла oauth. перейдите по этой ссылке


person Muhamamd Omar Muneer    schedule 09.12.2013    source источник


Ответы (1)


у вас опечатка:

oauth {
    providers {
        facebook {
            ...
        }
    }
}
person moskiteau    schedule 09.12.2013
comment
спасибо за ответ, не могли бы вы рассказать больше, в чем именно проблема? - person Muhamamd Omar Muneer; 10.12.2013