Spring Security OpenID Plugin
  1. Spring Security OpenID Plugin
  2. GPSPRINGSECURITYOPENID-19

Created the example project, but when I run it in debug mode, I get a ClassCircularityError exception

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Grails-Spring-Security-OpenID 1.0.2
    • Fix Version/s: None
    • Environment:
      # Grails version: 2.0.0.M2
      # Groovy version: 1.8.2
      # JVM version: 1.6.0_26

      Description

      If I kick off the example app with 'grails-debug run-app' I get:

      | Running Grails application
      
      Configuring Spring Security ...
      Configuring Spring Security OpenID ...
      | Error 2011-11-02 17:52:55,516 [Thread-9] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'openIDAuthenticationFilter': Initialization of bean failed; nested exception is java.lang.ClassCircularityError: org/springframework/beans/TypeMismatchException
          Line | Method
      ->>  527 | doCreateBean                    in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    580 | preInstantiateSingletons        in org.springframework.beans.factory.support.DefaultListableBeanFactory
      |    913 | finishBeanFactoryInitialization in org.springframework.context.support.AbstractApplicationContext
      |    464 | refresh                         in     ''
      |    153 | getApplicationContext . . . . . in org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration
      |    168 | configure                       in org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
      |    127 | configure . . . . . . . . . . . in     ''
      |    120 | configureWebApplicationContext  in org.codehaus.groovy.grails.web.context.GrailsConfigUtils
      |    103 | initWebApplicationContext . . . in org.codehaus.groovy.grails.web.context.GrailsContextLoader
      |    111 | contextInitialized              in org.springframework.web.context.ContextLoaderListener
      |   4723 | listenerStart . . . . . . . . . in org.apache.catalina.core.StandardContext
      |   5226 | call                            in org.apache.catalina.core.StandardContext$1
      |   5221 | call . . . . . . . . . . . . .  in     ''
      |    303 | innerRun                        in java.util.concurrent.FutureTask$Sync
      |    138 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
      |    886 | runTask                         in java.util.concurrent.ThreadPoolExecutor$Worker
      |    908 | run . . . . . . . . . . . . . . in     ''
      ^    680 | run                             in java.lang.Thread
      
      Caused by ClassCircularityError: org/springframework/beans/TypeMismatchException
      ->>  686 | createArgumentArray             in org.springframework.beans.factory.support.ConstructorResolver
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    196 | autowireConstructor             in     ''
      |   1003 | autowireConstructor . . . . . . in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    907 | createBeanInstance              in     ''
      |    485 | doCreateBean . . . . . . . . .  in     ''
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    322 | resolveReference                in org.springframework.beans.factory.support.BeanDefinitionValueResolver
      |    106 | resolveValueIfNecessary . . . . in     ''
      |    630 | resolveConstructorArguments     in org.springframework.beans.factory.support.ConstructorResolver
      |    148 | autowireConstructor . . . . . . in     ''
      |   1003 | autowireConstructor             in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    907 | createBeanInstance . . . . . .  in     ''
      |    485 | doCreateBean                    in     ''
      |    118 | doCreateBean . . . . . . . . .  in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean                      in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject . . . . . . . . . . . in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton                    in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean . . . . . . . . . . . in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean                         in     ''
      |    322 | resolveReference . . . . . . .  in org.springframework.beans.factory.support.BeanDefinitionValueResolver
      |    106 | resolveValueIfNecessary         in     ''
      |   1325 | applyPropertyValues . . . . . . in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |   1086 | populateBean                    in     ''
      |    517 | doCreateBean . . . . . . . . .  in     ''
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    580 | preInstantiateSingletons        in org.springframework.beans.factory.support.DefaultListableBeanFactory
      |    913 | finishBeanFactoryInitialization in org.springframework.context.support.AbstractApplicationContext
      |    464 | refresh                         in     ''
      |    153 | getApplicationContext . . . . . in org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration
      |    168 | configure                       in org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
      |    127 | configure . . . . . . . . . . . in     ''
      |    120 | configureWebApplicationContext  in org.codehaus.groovy.grails.web.context.GrailsConfigUtils
      |    103 | initWebApplicationContext . . . in org.codehaus.groovy.grails.web.context.GrailsContextLoader
      |    111 | contextInitialized              in org.springframework.web.context.ContextLoaderListener
      |   4723 | listenerStart . . . . . . . . . in org.apache.catalina.core.StandardContext
      |   5226 | call                            in org.apache.catalina.core.StandardContext$1
      |   5221 | call . . . . . . . . . . . . .  in     ''
      |    303 | innerRun                        in java.util.concurrent.FutureTask$Sync
      |    138 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
      |    886 | runTask                         in java.util.concurrent.ThreadPoolExecutor$Worker
      |    908 | run . . . . . . . . . . . . . . in     ''
      ^    680 | run                             in java.lang.Thread
      | Error 2011-11-02 17:52:55,616 [Thread-9] ERROR [localhost].[/openidtest]  - Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
          Line | Method
      ->>  527 | doCreateBean                    in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    580 | preInstantiateSingletons        in org.springframework.beans.factory.support.DefaultListableBeanFactory
      |    913 | finishBeanFactoryInitialization in org.springframework.context.support.AbstractApplicationContext
      |    464 | refresh                         in     ''
      |    153 | getApplicationContext . . . . . in org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration
      |    168 | configure                       in org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
      |    127 | configure . . . . . . . . . . . in     ''
      |    120 | configureWebApplicationContext  in org.codehaus.groovy.grails.web.context.GrailsConfigUtils
      |    103 | initWebApplicationContext . . . in org.codehaus.groovy.grails.web.context.GrailsContextLoader
      |    111 | contextInitialized              in org.springframework.web.context.ContextLoaderListener
      |   4723 | listenerStart . . . . . . . . . in org.apache.catalina.core.StandardContext
      |   5226 | call                            in org.apache.catalina.core.StandardContext$1
      |   5221 | call . . . . . . . . . . . . .  in     ''
      |    303 | innerRun                        in java.util.concurrent.FutureTask$Sync
      |    138 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
      |    886 | runTask                         in java.util.concurrent.ThreadPoolExecutor$Worker
      |    908 | run . . . . . . . . . . . . . . in     ''
      ^    680 | run                             in java.lang.Thread
      
      Caused by ClassCircularityError: org/springframework/beans/TypeMismatchException
      ->>  686 | createArgumentArray             in org.springframework.beans.factory.support.ConstructorResolver
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    196 | autowireConstructor             in     ''
      |   1003 | autowireConstructor . . . . . . in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    907 | createBeanInstance              in     ''
      |    485 | doCreateBean . . . . . . . . .  in     ''
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    322 | resolveReference                in org.springframework.beans.factory.support.BeanDefinitionValueResolver
      |    106 | resolveValueIfNecessary . . . . in     ''
      |    630 | resolveConstructorArguments     in org.springframework.beans.factory.support.ConstructorResolver
      |    148 | autowireConstructor . . . . . . in     ''
      |   1003 | autowireConstructor             in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    907 | createBeanInstance . . . . . .  in     ''
      |    485 | doCreateBean                    in     ''
      |    118 | doCreateBean . . . . . . . . .  in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean                      in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject . . . . . . . . . . . in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton                    in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean . . . . . . . . . . . in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean                         in     ''
      |    322 | resolveReference . . . . . . .  in org.springframework.beans.factory.support.BeanDefinitionValueResolver
      |    106 | resolveValueIfNecessary         in     ''
      |   1325 | applyPropertyValues . . . . . . in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |   1086 | populateBean                    in     ''
      |    517 | doCreateBean . . . . . . . . .  in     ''
      |    118 | doCreateBean                    in org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory
      |    456 | createBean . . . . . . . . . .  in org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
      |    295 | getObject                       in org.springframework.beans.factory.support.AbstractBeanFactory$1
      |    225 | getSingleton . . . . . . . . .  in org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      |    292 | doGetBean                       in org.springframework.beans.factory.support.AbstractBeanFactory
      |    194 | getBean . . . . . . . . . . . . in     ''
      |    580 | preInstantiateSingletons        in org.springframework.beans.factory.support.DefaultListableBeanFactory
      |    913 | finishBeanFactoryInitialization in org.springframework.context.support.AbstractApplicationContext
      |    464 | refresh                         in     ''
      |    153 | getApplicationContext . . . . . in org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration
      |    168 | configure                       in org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
      |    127 | configure . . . . . . . . . . . in     ''
      |    120 | configureWebApplicationContext  in org.codehaus.groovy.grails.web.context.GrailsConfigUtils
      |    103 | initWebApplicationContext . . . in org.codehaus.groovy.grails.web.context.GrailsContextLoader
      |    111 | contextInitialized              in org.springframework.web.context.ContextLoaderListener
      |   4723 | listenerStart . . . . . . . . . in org.apache.catalina.core.StandardContext
      |   5226 | call                            in org.apache.catalina.core.StandardContext$1
      |   5221 | call . . . . . . . . . . . . .  in     ''
      |    303 | innerRun                        in java.util.concurrent.FutureTask$Sync
      |    138 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
      |    886 | runTask                         in java.util.concurrent.ThreadPoolExecutor$Worker
      |    908 | run . . . . . . . . . . . . . . in     ''
      ^    680 | run                             in java.lang.Thread
      | Error 2011-11-02 17:52:55,630 [main] ERROR core.StandardContext  - Error listenerStart
      | Error 2011-11-02 17:52:55,635 [main] ERROR core.StandardContext  - Context [/openidtest] startup failed due to previous errors
      | Server running. Browse to http://localhost:8080/openidtest
      | Application loaded in interactive mode. Type 'exit' to shutdown.
      | Enter a script name to run. Use TAB for completion: 
      grails>
      

        Activity

        Hide
        Ricky added a comment -

        I had the same problem when I followed the tutorial on http://burtbeckwith.github.com/grails-spring-security-openid/docs/manual/index.html

        I happen to find more error information when the application was running in console: "ERROR context.GrailsContextLoader - Error executing bootstraps: No such property: password for class: BootStrap"

        And the reason was in BoolStrap.groovy, a pair of quot was missing around password after the colon

        def user = new User(username: 'user', password: password, enabled: true).save()
        def admin = new User(username: 'admin', password: password, enabled: true).save()

        change it to:
        def user = new User(username: 'user', password: 'password', enabled: true).save()
        def admin = new User(username: 'admin', password: 'password', enabled: true).save()

        Show
        Ricky added a comment - I had the same problem when I followed the tutorial on http://burtbeckwith.github.com/grails-spring-security-openid/docs/manual/index.html I happen to find more error information when the application was running in console: "ERROR context.GrailsContextLoader - Error executing bootstraps: No such property: password for class: BootStrap" And the reason was in BoolStrap.groovy, a pair of quot was missing around password after the colon def user = new User(username: 'user', password: password, enabled: true).save() def admin = new User(username: 'admin', password: password, enabled: true).save() change it to: def user = new User(username: 'user', password: 'password', enabled: true).save() def admin = new User(username: 'admin', password: 'password', enabled: true).save()
        Hide
        boillod manuel added a comment -

        I've got the same error, only in debug mode, and I don't have spring-security-openid plugin (but spring-security only)

        Show
        boillod manuel added a comment - I've got the same error, only in debug mode, and I don't have spring-security-openid plugin (but spring-security only)
        Hide
        boillod manuel added a comment -

        You should have a conflict in your dependencies.

        You could use 'grails dependencies-report' to show your dependencies.

        Personally I've removed ivy cache (~/.ivy-cache) to analyze what was downloaded by grails.

        Then you could select what dependencies to use in BuildConfig.groovy.

        A tips, if you put all your plugins into BuildConfig.groovy, the dependencies resolution is better.

        Regards,

        Show
        boillod manuel added a comment - You should have a conflict in your dependencies. You could use 'grails dependencies-report' to show your dependencies. Personally I've removed ivy cache (~/.ivy-cache) to analyze what was downloaded by grails. Then you could select what dependencies to use in BuildConfig.groovy. A tips, if you put all your plugins into BuildConfig.groovy, the dependencies resolution is better. Regards,
        Hide
        Andy Clement added a comment -

        Burt - this might be a reloading issue (Andy, could you try with -noreloading specified, I think it is 'grails-debug -noreloading run-app'). If it is then feel free to send it my way.

        Show
        Andy Clement added a comment - Burt - this might be a reloading issue (Andy, could you try with -noreloading specified, I think it is 'grails-debug -noreloading run-app'). If it is then feel free to send it my way.
        Hide
        Jason Lunn added a comment -

        Confirmed that adding -noreloading to the debugger invocation resolved the issue for me
        Grails 2.0.0
        Groovy 1.8.4
        JVM 1.6.0_29
        springSecurityCore - 1.2.7.2
        springSecurityOpenid - 1.0.3

        Show
        Jason Lunn added a comment - Confirmed that adding -noreloading to the debugger invocation resolved the issue for me Grails 2.0.0 Groovy 1.8.4 JVM 1.6.0_29 springSecurityCore - 1.2.7.2 springSecurityOpenid - 1.0.3
        Hide
        Tomas Romero added a comment -

        Actually, ading any argument after 'grails-debug' is working for me.

        e.g.: 'grails-debug -qwertyu'

        If I don't add any argunment, I get the ClassCircularityError: org/springframework/beans/TypeMismatchException.

        Show
        Tomas Romero added a comment - Actually, ading any argument after 'grails-debug' is working for me. e.g.: 'grails-debug -qwertyu' If I don't add any argunment, I get the ClassCircularityError: org/springframework/beans/TypeMismatchException.
        Hide
        David Donn added a comment -

        Had to disable reloading, as suggested, to avoid this issue. Using Grails 2.1.0, spring-security-core 1.2.7.3, spring-secutiry-openid 1.0.4. Real bummer that I have to disable reloading just to keep this plugin happy.

        Show
        David Donn added a comment - Had to disable reloading, as suggested, to avoid this issue. Using Grails 2.1.0, spring-security-core 1.2.7.3, spring-secutiry-openid 1.0.4. Real bummer that I have to disable reloading just to keep this plugin happy.
        Hide
        Ocom Software added a comment - - edited

        I think I have tracked this down to the following line in the SpringSecurityOpenidGrailsPlugin.groovy:93 file

        openIDAttributes(ArrayList, attrs)

        When grails does a reload it tries to create an ArrayList using the Constructor which takes an int and not an array. The Bean Conversion fails because spring is trying to convert a List (of OpenIDAttributes) into an int which fails.

        Only problem is, I cannot figure out how to fix this. I tried creating a BeanFactory for the OpenIDConsumer but my Spring Super powers are no match for the complexity of Spring. I don't know enough.

        I have put this comment in in the hope that someone smarter than me can fix it based on my analysis.

        Show
        Ocom Software added a comment - - edited I think I have tracked this down to the following line in the SpringSecurityOpenidGrailsPlugin.groovy:93 file openIDAttributes(ArrayList, attrs) When grails does a reload it tries to create an ArrayList using the Constructor which takes an int and not an array. The Bean Conversion fails because spring is trying to convert a List (of OpenIDAttributes) into an int which fails. Only problem is, I cannot figure out how to fix this. I tried creating a BeanFactory for the OpenIDConsumer but my Spring Super powers are no match for the complexity of Spring. I don't know enough. I have put this comment in in the hope that someone smarter than me can fix it based on my analysis.
        Hide
        Ocom Software added a comment - - edited

        I think I have fixed this. I am unable to make the changes. But this may help other people...

        Change the line above (SpringSecurityOpenidGrailsPlugin.groovy:93) to these lines.

        openIDAttributes(org.springframework.beans.factory.config.ListFactoryBean)

        { targetListClass = ArrayList sourceList = attrs }

        Can someone with the right permissions make the change so we can use the plugin and have reloading available??

        Thanks for Ian Roberts for his help with someone else's issue. (http://grails.1312388.n4.nabble.com/Simple-Newbie-resources-groovy-problem-td4632526.html)

        Show
        Ocom Software added a comment - - edited I think I have fixed this. I am unable to make the changes. But this may help other people... Change the line above (SpringSecurityOpenidGrailsPlugin.groovy:93) to these lines. openIDAttributes(org.springframework.beans.factory.config.ListFactoryBean) { targetListClass = ArrayList sourceList = attrs } Can someone with the right permissions make the change so we can use the plugin and have reloading available?? Thanks for Ian Roberts for his help with someone else's issue. ( http://grails.1312388.n4.nabble.com/Simple-Newbie-resources-groovy-problem-td4632526.html )

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Andy Perrine
          • Votes:
            8 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated: