Hello,

 I try to integrate mongodb as a persistant backend for the CAS web management.
 I follow the documentation here :
https://jasig.github.io/cas/development/installation/Mongo-Service-Management.html

 But every time I tried to compile with maven I get this message :

 -------------------------------------------------------------------------------
Test set: org.jasig.cas.WiringTests
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.959 sec <<< 
FAILURE! - in org.jasig.cas.WiringTests
verifyWiring(org.jasig.cas.WiringTests)  Time elapsed: 0.959 sec  <<< ERROR!
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'manageRegisteredServicesMultiActionController' defined 
in file 
[/root/cas-4.1.3-dev/cas-management-webapp/target/classes/org/jasig/cas/services/web/ManageRegisteredServicesMultiActionController.class]:
 Unsatisfied dependency expressed through constructor argument with index 0 of 
type [org.jasig.cas.services.ReloadableServicesManager]: : Error creating bean 
with name 'servicesManager' defined in file 
[/root/cas-4.1.3-dev/cas-management-webapp/src/main/webapp/WEB-INF/spring-configuration/applicationContext.xml]:
 Cannot resolve reference to bean 'serviceRegistryDao' while setting 
constructor argument; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 
'mongoServiceRegistryDao' is defined; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'servicesManager' defined in file 
[/root/cas-4.1.3-dev/cas-management-webapp/src/main/webapp/WEB-INF/spring-configuration/applicationContext.xml]:
 Cannot resolve reference to bean 'serviceRegistryDao' while setting 
constructor argument; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 
'mongoServiceRegistryDao' is defined
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1168)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:281)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
        at 
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:648)
        at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:140)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1137)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
        at 
org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
        at 
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
        at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1137)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
        at org.jasig.cas.WiringTests.setUp(WiringTests.java:58)


It works like a charm with JPA service registry. But how can I use mongodb ? 
Did I miss anything in the documentation ?
I tried a lot a workaround which led me to success in compiling the cas web 
management war but always with a mongodb
integration failure after web deployment into Tomcat 7, with this message :

2015-12-27 20:57:27,370 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name 'mongo'>
2015-12-27 20:57:27,372 DEBUG 
[org.springframework.beans.factory.support.DefaultListableBeanFactory] - 
<Retrieved dependent beans for bean '(inner bean)#4542633a': [mongo]>
2015-12-27 20:57:27,373 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name '(inner bean)#4542633a'>
2015-12-27 20:57:27,373 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name 'characterEncodingFilter'>
2015-12-27 20:57:27,374 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name 'auditResourceResolverMap'>
2015-12-27 20:57:27,374 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name 'auditActionResolverMap'>
2015-12-27 20:57:27,374 DEBUG 
[org.springframework.beans.factory.support.DisposableBeanAdapter] - <Invoking 
destroy() on bean with name 'basenames'>
2015-12-27 20:57:27,376 ERROR [org.springframework.web.context.ContextLoader] - 
<Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'servicesManager' defined in ServletContext resource 
[/WEB-INF/spring-configuration/applicati
onContext.xml]: Bean instantiation via constructor failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[org.jasig.cas.services.D
efaultServicesManagerImpl]: Constructor threw exception; nested exception is 
java.lang.NullPointerException
        at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1137)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1040)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
        at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
        at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
        at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
        at 
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
        at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973)
        at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
        at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [org.jasig.cas.services.DefaultServicesManagerImpl]: Constructor 
threw exception; nested exce
ption is java.lang.NullPointerException
        at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163)
        at 
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122)
        at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267)
        ... 27 more
Caused by: java.lang.NullPointerException
        at 
org.jasig.cas.services.MongoServiceRegistryDao.load(MongoServiceRegistryDao.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at 
org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy27.load(Unknown Source)
        at 
org.jasig.cas.services.DefaultServicesManagerImpl.load(DefaultServicesManagerImpl.java:165)
        at 
org.jasig.cas.services.DefaultServicesManagerImpl.<init>(DefaultServicesManagerImpl.java:60)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
        ... 29 more
>
déc. 27, 2015 8:57:27 PM org.apache.catalina.core.StandardContext startInternal
GRAVE: Error listenerStart
2015-12-27 20:57:27,381 DEBUG [org.mongodb.driver.connection] - <Closing 
connection connectionId{localValue:1}>
2015-12-27 20:57:27,382 DEBUG [org.mongodb.driver.connection] - <Closing 
connection connectionId{localValue:1}>

  Help will be greatly appreciated.

   Thank you,

  ___________________________________
 /                                   \
/-------------------------------------\
|  Guy CARRÉ                          |
|  *************                      |
|  PostMaster - WikiMaster - SysAdmin |
|                                     |
| "Free Your Mind. Think Open Source" |
|  april.org                          |
|                                     |
|_____________________________________|

-- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.

Reply via email to