gauth with mongo: CAS crashes when edited cas.properties

25 views
Skip to first unread message

He Vincent

unread,
Aug 2, 2021, 5:09:53 AM8/2/21
to CAS Community
I have a CAS which is running in production, it gets out of service intermittency.  It annoyed me a lot. I happedned to find out that it was due to I was chaning cas.properties.

I suspected it was due to gauth, I tested it was a prand new configure:
for pom.xml, I added only 2 artifacts:
               <dependency>
                    <groupId>org.apereo.cas</groupId>
                    <artifactId>cas-server-support-gauth</artifactId>
                    <version>${cas.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apereo.cas</groupId>
                    <artifactId>cas-server-support-gauth-mongo</artifactId>
                    <version>${cas.version}</version>
                </dependency>

For cas.properties, add 2FA and mongoDB itmes:

cas.authn.mfa.gauth.issuer=cs530
cas.authn.mfa.gauth.label=cas530
cas.authn.mfa.gauth.trustedDeviceEnabled=true


cas.authn.mfa.gauth.mongo.host=127.0.0.1
cas.authn.mfa.gauth.mongo.port=27017
cas.authn.mfa.gauth.mongo.userId=cas530
cas.authn.mfa.gauth.mongo.password=Welcome1
cas.authn.mfa.gauth.mongo.databaseName=cas530
cas.authn.mfa.gauth.mongo.dropCollection=false
cas.authn.mfa.gauth.mongo.socketKeepAlive=false
cas.authn.mfa.gauth.mongo.retryWrites=false

I started it as:
java -jar target/cas.war

I tested login with casuser:Mellon, works fine:

Then I edited  cas.properties, saved the file, cas got below error:
2021-08-02 16:53:21,151 WARN [org.apereo.cas.util.io.PathWatcherService] - <Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?>
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE
....
2021-08-02 16:53:23,741 WARN [org.apereo.cas.util.io.PathWatcherService] - <Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?>
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.getTarget(CglibAopProxy.java:703) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor$$EnhancerBySpringCGLIB$$ad7263a6.postProcessBeforeInitialization(<generated>) ~[spring-tx-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
... ....
2021-08-02 16:53:24,534 WARN [org.apereo.cas.util.io.PathWatcherService] - <Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?>
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.getTarget(CglibAopProxy.java:703) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653) ~[spring-aop-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor$$EnhancerBySpringCGLIB$$ad7263a6.postProcessBeforeInitialization(<generated>) ~[spring-tx-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:407) ~[spring-beans-4.3.25.RELEASE.jar!/:4.3.25.RELEASE]
.... ...
2021-08-02 16:53:32,049 ERROR [org.springframework.integration.handler.LoggingHandler] - <org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.authenticationThrottle' defined in class path resource [org/apereo/cas/web/support/config/CasThrottlingConfiguration.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'scopedTarget.persistenceExceptionTranslationPostProcessor': Requested bean is currently in creation: Is there an unresolvable circular reference?
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
        at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:351)
        at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:379)
        at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:181)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:346)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
        at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:35)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:192)
        at com.sun.proxy.$Proxy172.decrement(Unknown Source)
....


He Vincent

unread,
Aug 2, 2021, 5:15:14 AM8/2/21
to CAS Community, He Vincent
I can reproduce the bug at will.
Reply all
Reply to author
Forward
0 new messages