Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-8152

LDAP config error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: ldap-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.386; Windows XP; Hudson's built-in container (no Tomcat)
    • Similar Issues:

      Description

      Configuring LDAP authentication in Hudson:

      Server: ldaps://directory.sri.com
      root DN: o=SRI International,c=US
      User search base:
      User search filter: uid=

      {0}

      Group search base:
      Manager DN:
      Manager Password:

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initialDirContextFactory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:231)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:957)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:869)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:514)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
      at hudson.util.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:94)
      at hudson.util.spring.BeanBuilder.createApplicationContext(BeanBuilder.java:388)
      at hudson.security.LDAPSecurityRealm.createSecurityComponents(LDAPSecurityRealm.java:344)
      at hudson.security.SecurityRealm.getSecurityComponents(SecurityRealm.java:359)
      at hudson.security.HudsonFilter.reset(HudsonFilter.java:134)
      at hudson.model.Hudson.setSecurityRealm(Hudson.java:1833)
      at hudson.model.Hudson.doConfigSubmit(Hudson.java:2345)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:102)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:478)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:160)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:98)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
      at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:225)
      ... 68 more
      Caused by: java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
      at org.acegisecurity.ldap.DefaultInitialDirContextFactory.setProviderUrl(DefaultInitialDirContextFactory.java:151)
      at org.acegisecurity.ldap.DefaultInitialDirContextFactory.(DefaultInitialDirContextFactory.java:124)
      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:83)
      ... 70 more

        Attachments

          Issue Links

            Activity

            Hide
            harrygg Harry G. added a comment - - edited

            I believe I found the reason for a variant of this problem, as discussed here: http://hudson.361315.n4.nabble.com/Active-Directory-problem-td1290316.html

            When leaving RootDN empty, Hudson fills in something like
            "defaultNamingContext: DC=de,DC=mycompany,DC=com"
            where it should be
            "DC=de,DC=mycompany,DC=com"

            So the string "defaultNamingContext: " should be omited.

            Show
            harrygg Harry G. added a comment - - edited I believe I found the reason for a variant of this problem, as discussed here: http://hudson.361315.n4.nabble.com/Active-Directory-problem-td1290316.html When leaving RootDN empty, Hudson fills in something like "defaultNamingContext: DC=de,DC=mycompany,DC=com" where it should be "DC=de,DC=mycompany,DC=com" So the string "defaultNamingContext: " should be omited.
            Hide
            cjyar cjyar added a comment -

            In this case, the problem was caused by the space in our root DN. Replacing the space with %20 fixed it. However, it would be great if Hudson could provide a more helpful error message.

            Show
            cjyar cjyar added a comment - In this case, the problem was caused by the space in our root DN. Replacing the space with %20 fixed it. However, it would be great if Hudson could provide a more helpful error message.
            Hide
            harrygg Harry G. added a comment - - edited

            I would like to propose to fix three issues here:

            • automatically replace spaces by %20 (and other common URL parsing functionality like backslashes)
            • omit "defaultNamingContext: " when creating a default value for RootDN
            • in case of invalid root DN give a helpful error message directly nearby the RootDN entry field, like with other values - not an exception on save
            Show
            harrygg Harry G. added a comment - - edited I would like to propose to fix three issues here: automatically replace spaces by %20 (and other common URL parsing functionality like backslashes) omit "defaultNamingContext: " when creating a default value for RootDN in case of invalid root DN give a helpful error message directly nearby the RootDN entry field, like with other values - not an exception on save
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            changelog.html
            core/src/main/java/hudson/security/LDAPSecurityRealm.java
            http://jenkins-ci.org/commit/jenkins/c99fc315dddf707dba3a2dea6a048bd76dce4c2e
            Log:
            [FIXED JENKINS-8152]

            Formatting error in the rootDN inference code. It shouldn't include
            attribute name.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/src/main/java/hudson/security/LDAPSecurityRealm.java http://jenkins-ci.org/commit/jenkins/c99fc315dddf707dba3a2dea6a048bd76dce4c2e Log: [FIXED JENKINS-8152] Formatting error in the rootDN inference code. It shouldn't include attribute name.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1502
            [FIXED JENKINS-8152] (Revision c99fc315dddf707dba3a2dea6a048bd76dce4c2e)

            Result = SUCCESS
            Kohsuke Kawaguchi : c99fc315dddf707dba3a2dea6a048bd76dce4c2e
            Files :

            • core/src/main/java/hudson/security/LDAPSecurityRealm.java
            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1502 [FIXED JENKINS-8152] (Revision c99fc315dddf707dba3a2dea6a048bd76dce4c2e) Result = SUCCESS Kohsuke Kawaguchi : c99fc315dddf707dba3a2dea6a048bd76dce4c2e Files : core/src/main/java/hudson/security/LDAPSecurityRealm.java changelog.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stig Kleppe-Jørgensen
            Path:
            src/main/java/hudson/plugins/promoted_builds/Promotion.java
            http://jenkins-ci.org/commit/promoted-builds-plugin/9b79be8796fe054ed02fa1d3ca01f57542e5fa83
            Log:
            Merge pull request #11 from ybonnel/master

            [FIXES JENKINS-8152] Adds PROMOTED_<scm stuff> variables for SCM information

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stig Kleppe-Jørgensen Path: src/main/java/hudson/plugins/promoted_builds/Promotion.java http://jenkins-ci.org/commit/promoted-builds-plugin/9b79be8796fe054ed02fa1d3ca01f57542e5fa83 Log: Merge pull request #11 from ybonnel/master [FIXES JENKINS-8152] Adds PROMOTED_<scm stuff> variables for SCM information
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/main/java/hudson/security/LDAPSecurityRealm.java
            http://jenkins-ci.org/commit/jenkins/fa95a3a439584e6a19349360c6c4f68a7a404e01
            Log:
            [FIXED JENKINS-8152]

            Formatting error in the rootDN inference code. It shouldn't include
            attribute name.

            Cherry-picked-from: c99fc315dddf707dba3a2dea6a048bd76dce4c2e

            Compare: https://github.com/jenkinsci/jenkins/compare/a7e3bae...fa95a3a

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/security/LDAPSecurityRealm.java http://jenkins-ci.org/commit/jenkins/fa95a3a439584e6a19349360c6c4f68a7a404e01 Log: [FIXED JENKINS-8152] Formatting error in the rootDN inference code. It shouldn't include attribute name. Cherry-picked-from: c99fc315dddf707dba3a2dea6a048bd76dce4c2e Compare: https://github.com/jenkinsci/jenkins/compare/a7e3bae...fa95a3a
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Kohsuke Kawaguchi
            Path:
            core/src/main/java/hudson/security/LDAPSecurityRealm.java
            http://jenkins-ci.org/commit/ldap-plugin/c32808c8d74c4b5508689040863529c3676defc4
            Log:
            [FIXED JENKINS-8152]

            Formatting error in the rootDN inference code. It shouldn't include
            attribute name.

            Originally-Committed-As: c99fc315dddf707dba3a2dea6a048bd76dce4c2e

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/security/LDAPSecurityRealm.java http://jenkins-ci.org/commit/ldap-plugin/c32808c8d74c4b5508689040863529c3676defc4 Log: [FIXED JENKINS-8152] Formatting error in the rootDN inference code. It shouldn't include attribute name. Originally-Committed-As: c99fc315dddf707dba3a2dea6a048bd76dce4c2e
            Hide
            gameshas Justinas Urbanavicius added a comment -

            the problem is back in Jenkins v1.546 LDAP plugin v1.7
            if Root DN contains a space it throws exception that root DNs must be the same

            javax.servlet.ServletException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initialDirContextFactory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
            	at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:390)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
            	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
            	at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
            	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
            	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
            	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
            	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
            	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
            	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
            	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
            	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
            	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
            	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
            	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
            	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
            	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
            	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
            	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
            	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
            	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
            	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
            	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
            	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
            	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
            	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
            	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
            	at org.eclipse.jetty.server.Server.handle(Server.java:370)
            	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
            	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
            	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
            	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
            	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
            	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
            	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
            	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
            	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
            	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:724)
            Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initialDirContextFactory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
            	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
            	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
            	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
            	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.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:388)
            	at hudson.security.LDAPSecurityRealm.createSecurityComponents(LDAPSecurityRealm.java:515)
            	at hudson.security.SecurityRealm.getSecurityComponents(SecurityRealm.java:398)
            	at hudson.security.HudsonFilter.reset(HudsonFilter.java:134)
            	at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2051)
            	at hudson.security.GlobalSecurityConfiguration.configure(GlobalSecurityConfiguration.java:94)
            	at hudson.security.GlobalSecurityConfiguration.doConfigure(GlobalSecurityConfiguration.java:78)
            	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.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
            	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
            	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
            	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
            	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
            	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
            	... 62 more
            Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
            	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
            	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
            	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
            	... 94 more
            Caused by: java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs
            	at org.acegisecurity.ldap.DefaultInitialDirContextFactory.setProviderUrl(DefaultInitialDirContextFactory.java:151)
            	at org.acegisecurity.ldap.DefaultInitialDirContextFactory.<init>(DefaultInitialDirContextFactory.java:124)
            	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:100)
            	... 96 more
            
            Show
            gameshas Justinas Urbanavicius added a comment - the problem is back in Jenkins v1.546 LDAP plugin v1.7 if Root DN contains a space it throws exception that root DNs must be the same javax.servlet.ServletException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initialDirContextFactory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858) at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:390) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631) at org.kohsuke.stapler.Stapler.service(Stapler.java:225) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96) at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482) at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84) at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:174) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at jenkins.security.ApiTokenFilter.doFilter(ApiTokenFilter.java:64) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67) at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87) at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76) at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:370) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52) at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77) 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:724) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initialDirContextFactory': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835) 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.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:388) at hudson.security.LDAPSecurityRealm.createSecurityComponents(LDAPSecurityRealm.java:515) at hudson.security.SecurityRealm.getSecurityComponents(SecurityRealm.java:398) at hudson.security.HudsonFilter.reset(HudsonFilter.java:134) at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2051) at hudson.security.GlobalSecurityConfiguration.configure(GlobalSecurityConfiguration.java:94) at hudson.security.GlobalSecurityConfiguration.doConfigure(GlobalSecurityConfiguration.java:78) 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.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96) at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120) at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728) ... 62 more Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.acegisecurity.ldap.DefaultInitialDirContextFactory]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248) ... 94 more Caused by: java.lang.IllegalArgumentException: Root DNs must be the same when using multiple URLs at org.acegisecurity.ldap.DefaultInitialDirContextFactory.setProviderUrl(DefaultInitialDirContextFactory.java:151) at org.acegisecurity.ldap.DefaultInitialDirContextFactory.<init>(DefaultInitialDirContextFactory.java:124) 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:100) ... 96 more
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Fixed the component

            Show
            oleg_nenashev Oleg Nenashev added a comment - Fixed the component
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andres Rodriguez
            Path:
            src/main/java/hudson/security/LDAPSecurityRealm.java
            src/test/java/hudson/security/LDAPSecurityRealm_Test.java
            http://jenkins-ci.org/commit/ldap-plugin/5065f52e78fe61a32bf525d8b3f69b27f3276242
            Log:
            JENKINS-8152 Encode rootDN in provider URL.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andres Rodriguez Path: src/main/java/hudson/security/LDAPSecurityRealm.java src/test/java/hudson/security/LDAPSecurityRealm_Test.java http://jenkins-ci.org/commit/ldap-plugin/5065f52e78fe61a32bf525d8b3f69b27f3276242 Log: JENKINS-8152 Encode rootDN in provider URL.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Andres Rodriguez
            Path:
            src/main/java/hudson/security/LDAPSecurityRealm.java
            src/test/java/hudson/security/LDAPSecurityRealm_Test.java
            http://jenkins-ci.org/commit/ldap-plugin/b0b86221a898ecbd95c005ceda57a67533833314
            Log:
            Merge pull request #9 from andresrc/JENKINS-8152

            JENKINS-8152 Encode rootDN in provider URL.

            Compare: https://github.com/jenkinsci/ldap-plugin/compare/5156fed02384...b0b86221a898

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andres Rodriguez Path: src/main/java/hudson/security/LDAPSecurityRealm.java src/test/java/hudson/security/LDAPSecurityRealm_Test.java http://jenkins-ci.org/commit/ldap-plugin/b0b86221a898ecbd95c005ceda57a67533833314 Log: Merge pull request #9 from andresrc/ JENKINS-8152 JENKINS-8152 Encode rootDN in provider URL. Compare: https://github.com/jenkinsci/ldap-plugin/compare/5156fed02384...b0b86221a898
            Hide
            andresrc Andres Rodriguez added a comment -

            Released as 1.13

            Show
            andresrc Andres Rodriguez added a comment - Released as 1.13

              People

              Assignee:
              andresrc Andres Rodriguez
              Reporter:
              cjyar cjyar
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: