org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN

Spring JIRA | Harry Clark | 6 years ago
  1. 0

    I'm using the embedded LDAP server for development and testing. It blows up with Caused by: java.lang.ClassNotFoundException: org.apache.directory.shared.ldap.name.LdapDN Stack trace below. A search reveals that this class is in these jars: http://www.jarfinder.com/index.php/java/info/org.apache.directory.shared.ldap.name.LdapDN.2 which all date from earlier versions of shared-ldap, latest there is 0.9.13. There is a 0.9.19 with the current (1.5.7) ApacheDS distro but it doesn't have the exception class for name not found. Using shared-all.0.9.18 gets you to the exception for missing name class. I looked at an earlier version of ApacheDS, which included Spring 2.0 jars, didn't pursue it. Everything needed to reproduce this is in the little attachment, source, xml, and list of jars. This is a Java console app. Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) at com.kve.requisitions.main.Main.main(Main.java:19) Caused by: java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2402) at java.lang.Class.getDeclaredConstructors(Class.java:1851) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:157) ... 14 more Caused by: java.lang.ClassNotFoundException: org.apache.directory.shared.ldap.name.LdapDN at java.net.URLClassLoader$1.run(URLClassLoader.java:299) at java.net.URLClassLoader$1.run(URLClassLoader.java:288) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:287) at java.lang.ClassLoader.loadClass(ClassLoader.java:399) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325) at java.lang.ClassLoader.loadClass(ClassLoader.java:332) ... 18 more

    Spring JIRA | 6 years ago | Harry Clark
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN
  2. 0

    LDAP-219: Embedded LDAP tries to create class not in current ApacheDS

    GitHub | 6 years ago | spring-issuemaster
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN
  3. 0

    I'm using the embedded LDAP server for development and testing. It blows up with Caused by: java.lang.ClassNotFoundException: org.apache.directory.shared.ldap.name.LdapDN Stack trace below. A search reveals that this class is in these jars: http://www.jarfinder.com/index.php/java/info/org.apache.directory.shared.ldap.name.LdapDN.2 which all date from earlier versions of shared-ldap, latest there is 0.9.13. There is a 0.9.19 with the current (1.5.7) ApacheDS distro but it doesn't have the exception class for name not found. Using shared-all.0.9.18 gets you to the exception for missing name class. I looked at an earlier version of ApacheDS, which included Spring 2.0 jars, didn't pursue it. Everything needed to reproduce this is in the little attachment, source, xml, and list of jars. This is a Java console app. Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:160) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93) at com.kve.requisitions.main.Main.main(Main.java:19) Caused by: java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2402) at java.lang.Class.getDeclaredConstructors(Class.java:1851) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:157) ... 14 more Caused by: java.lang.ClassNotFoundException: org.apache.directory.shared.ldap.name.LdapDN at java.net.URLClassLoader$1.run(URLClassLoader.java:299) at java.net.URLClassLoader$1.run(URLClassLoader.java:288) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:287) at java.lang.ClassLoader.loadClass(ClassLoader.java:399) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325) at java.lang.ClassLoader.loadClass(ClassLoader.java:332) ... 18 more

    Spring JIRA | 6 years ago | Harry Clark
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.apacheDirectoryServerContainer': Resolution of declared constructors on bean Class [org.springframework.security.ldap.server.ApacheDSContainer] from ClassLoader [sun.misc.Launcher$AppClassLoader@a90653] failed; nested exception is java.lang.NoClassDefFoundError: org/apache/directory/shared/ldap/name/LdapDN
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Adding Jackson to POM causes NoClassDefError for JsonProcessingException

    Stack Overflow | 2 years ago | Grendus
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException
  6. 0

    hadoop: Adding Jackson to POM causes NoClassDefError for JsonProcessingException

    blogspot.com | 11 months ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException

  1. davidvanlaatum 10 times, last 6 months ago
25 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    org.apache.directory.shared.ldap.name.LdapDN

    at java.net.URLClassLoader$1.run()
  2. Java RT
    Class.getDeclaredConstructors
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:299)
    2. java.net.URLClassLoader$1.run(URLClassLoader.java:288)
    3. java.security.AccessController.doPrivileged(Native Method)
    4. java.net.URLClassLoader.findClass(URLClassLoader.java:287)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:399)
    6. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325)
    7. java.lang.ClassLoader.loadClass(ClassLoader.java:332)
    8. java.lang.Class.getDeclaredConstructors0(Native Method)
    9. java.lang.Class.privateGetDeclaredConstructors(Class.java:2402)
    10. java.lang.Class.getDeclaredConstructors(Class.java:1851)
    10 frames
  3. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:157)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    6. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    7. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    10. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    10 frames
  4. Spring Context
    ClassPathXmlApplicationContext.<init>
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    4 frames
  5. com.kve.requisitions
    Main.main
    1. com.kve.requisitions.main.Main.main(Main.java:19)
    1 frame