Active directory plugin failing to connect to server after restarting Windows Server 2k12R2

920 views
Skip to first unread message

John Weismiller

unread,
Apr 17, 2015, 1:13:27 PM4/17/15
to jenkins...@googlegroups.com
Hi all,

I am attempting to setup a Jenkins installation (currently in a testing virtual machine), and I would like to use active directory so that I don't need to manage the users.

Everything works perfectly fine after I enable the plugin, and I can log in using my local windows account.  However, when I restart the virtual machine and attempt to load the Jenkins web page, I get an exception page.  If I then manually restart the service from the command line using "net stop Jenkins" followed by "net start Jenkins", everything works fine again.  Has anybody seen anything like this before?  

Thanks,
John

Here is the error that I get:
hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager': Cannot resolve reference to bean 'activeDirectory' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activeDirectory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider]: Constructor threw exception; nested exception is org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at hudson.WebAppMain$3.run(WebAppMain.java:237)
Caused by: org.jvnet.hudson.reactor.ReactorException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager': Cannot resolve reference to bean 'activeDirectory' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activeDirectory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider]: Constructor threw exception; nested exception is org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:915)
	at jenkins.model.Jenkins.<init>(Jenkins.java:814)
	at hudson.model.Hudson.<init>(Hudson.java:83)
	at hudson.model.Hudson.<init>(Hudson.java:79)
	at hudson.WebAppMain$3.run(WebAppMain.java:225)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager': Cannot resolve reference to bean 'activeDirectory' while setting bean property 'providers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activeDirectory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider]: Constructor threw exception; nested exception is org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
	at hudson.util.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:94)
	at hudson.util.spring.BeanBuilder.createApplicationContext(BeanBuilder.java:390)
	at hudson.plugins.active_directory.ActiveDirectorySecurityRealm.createSecurityComponents(ActiveDirectorySecurityRealm.java:183)
	at hudson.security.SecurityRealm.getSecurityComponents(SecurityRealm.java:448)
	at hudson.security.HudsonFilter.reset(HudsonFilter.java:135)
	at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2121)
	at jenkins.model.Jenkins$19.run(Jenkins.java:2713)
	at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
	at jenkins.model.Jenkins$7.runTask(Jenkins.java:904)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activeDirectory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider]: Constructor threw exception; nested exception is org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
	... 32 more
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider]: Constructor threw exception; nested exception is org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
	... 43 more
Caused by: org.kohsuke.stapler.framework.io.IOException2: Failed to connect to Active Directory. Does this machine belong to Active Directory?
	at hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider.<init>(ActiveDirectoryAuthenticationProvider.java:82)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
	... 45 more
Caused by: com4j.ExecutionException: com4j.ComException: 8007054b Failed to MkParseDisplayName : The specified domain either does not exist or could not be contacted. : .\com4j.cpp:217
	at com4j.ComThread.execute(ComThread.java:236)
	at com4j.Task.execute(Task.java:26)
	at com4j.COM4J.getObject(COM4J.java:258)
	at hudson.plugins.active_directory.ActiveDirectoryAuthenticationProvider.<init>(ActiveDirectoryAuthenticationProvider.java:73)
	... 50 more
Caused by: com4j.ComException: 8007054b Failed to MkParseDisplayName : The specified domain either does not exist or could not be contacted. : .\com4j.cpp:217
	at com4j.Native.getObject(Native Method)
	at com4j.COM4J$GetObjectTask.call(COM4J.java:279)
	at com4j.COM4J$GetObjectTask.call(COM4J.java:267)
	at com4j.Task.invoke(Task.java:50)
	at com4j.ComThread.run0(ComThread.java:172)
	at com4j.ComThread.run(ComThread.java:153)




John Weismiller

unread,
Apr 17, 2015, 5:52:51 PM4/17/15
to jenkins...@googlegroups.com
Update: I think I figured it out.  It appears that the service is started before the rest of the networking subsystem is up.

I manually added the following within the <service/> block to C:\Program Files (x86)\Jenkins\Jenkins.xml:
<depend>DNS</depend>

Then stopped the Jenkins service, and unregistered and registered the service using the following in an administrative command prompt:
> cd \Program Files (x86)\Jenkins
> net stop jenkins
> jenkins uninstall
> jenkins install
> net start jenkins

Now Jenkins seems to come up properly each time I reboot.

Disclaimer: I'm not sure if that is the correct dependency, but it works for me.

John
Reply all
Reply to author
Forward
0 new messages