Project

General

Profile

Actions

User story #2883

closed

Rudder webapps should be able to start even if no LDAP server is available

Added by Jonathan CLARKE about 12 years ago. Updated almost 3 years ago.

Status:
Rejected
Priority:
3
Assignee:
-
Category:
Architecture - Code maintenance
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:

Description

Rudder's main webapp is now resilient to LDAP disappearing while it's running, and will display nice error messages when no LDAP is available, then run again fine when LDAP comes back.

However it is impossible to start the webapp if no LDAP server is running, we get this in the logs:

This makes running scripts to start services difficult. Can it be changed?

11:12:17.496 [main]            INFO  b.l.AppConfigAuth$$EnhancerByCGLIB$$33de5f3d - Use configuration file defined by JVM property -Drudder.authFile : /opt/rudder/etc/rudder-users.xml
11:12:18.380 [main]            ERROR o.s.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapNodeConfigurationMapper' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.rudder.repository.ldap.LDAPNodeConfigurationMapper bootstrap.liftweb.AppConfig.ldapNodeConfigurationMapper()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) ~[spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) ~[spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) ~[spring-web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) ~[spring-web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.3.RELEASE.jar:3.0.3.RELEASE]
    at bootstrap.liftweb.LiftInitContextListener.contextInitialized(LiftContextInitListener.scala:84) [classes/:na]
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:641) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:228) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1181) [jetty-webapp-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:584) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:496) [jetty-webapp-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:36) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:180) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:481) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:137) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:137) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:50) [jetty-deploy-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:470) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:382) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.Scanner.scan(Scanner.java:339) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.rudder.repository.ldap.LDAPNodeConfigurationMapper bootstrap.liftweb.AppConfig.ldapNodeConfigurationMapper()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ....
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ...
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ...
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ....
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ...
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ...
Caused by: com.unboundid.ldap.sdk.LDAPException: An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused
    at com.unboundid.ldap.sdk.LDAPConnection.connect(LDAPConnection.java:705) ~[unboundid-ldapsdk-2.2.0.jar:2.2.0]
    ...
2012-09-10 11:12:18.381:WARN::Failed startup of context o.e.j.w.WebAppContext{/rudder,file:/tmp/jetty-127.0.0.1-8080-rudder.war-_rudder-any-/webapp/},/opt/rudder/jetty7/webapps/rudder.war
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapNodeConfigurationMapper' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.rudder.repository.ldap.LDAPNodeConfigurationMapper bootstrap.liftweb.AppConfig.ldapNodeConfigurationMapper()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983)
    ...
Caused by: 
org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.rudder.repository.ldap.LDAPNodeConfigurationMapper bootstrap.liftweb.AppConfig.ldapNodeConfigurationMapper()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157)
    ...
Caused by: 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackageService' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.impl.PolicyPackageServiceImpl bootstrap.liftweb.AppConfig.policyPackageService()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'policyPackagesReader' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.cfclerk.services.PolicyPackagesReader bootstrap.liftweb.AppConfig.policyPackagesReader()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldap' defined in class bootstrap.liftweb.AppConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public com.normation.ldap.sdk.PooledSimpleAuthConnectionProvider bootstrap.liftweb.AppConfig.ldap()] threw exception; nested exception is LDAPException(resultCode=91 (connect error), errorMessage='An error occurred while attempting to connect to server localhost:389:  java.io.IOException: An error occurred while attempting to establish a connection to server localhost:389:  java.net.ConnectException: Connection refused')
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)
    ......

Related issues 1 (0 open1 closed)

Has duplicate Rudder - Bug #4919: security:authorize access="isAnonymous()"Rejected2014-06-02Actions
Actions

Also available in: Atom PDF