org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleBean' defined in file [C:\Users\owner\Documents\Java Project\MyWorkSpace\springMVCSecond\WebContent\WEB-INF\classes\com\domain\SimpleBean.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.domain.SimpleBean$$EnhancerByCGLIB$$4bc418be]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.domain.SimpleBean$$EnhancerByCGLIB$$4bc418be.<init>()

  1. 0

    Constructor injection using Spring annotation @Autowired does not work

    Stack Overflow | 5 years ago | Kaushik Lele
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simpleBean' defined in file [C:\Users\owner\Documents\Java Project\MyWorkSpace\springMVCSecond\WebContent\WEB-INF\classes\com\domain\SimpleBean.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.domain.SimpleBean$$EnhancerByCGLIB$$4bc418be]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.domain.SimpleBean$$EnhancerByCGLIB$$4bc418be.<init>()
  2. 0

    NoSuchMethodException when using Spring ThreadPoolTaskExecutor

    Stack Overflow | 2 years ago | Omer
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adSyncTaskPool' defined in URL [jar:file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/ad-mgmt/WEB-INF/lib/component-stats-sync-impl2-0.0.1-SNAPSHOT.jar!/me/somesome/task/SyncTaskPool.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [me.somesome.task.SyncTaskPool]: No default constructor found; nested exception is java.lang.NoSuchMethodException: me.somesome.task.SyncTaskPool.&lt;init&gt;() at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076) ~[spring-beans-4.0.5.RELEASE.jar:4.0.5.RELEASE]
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Spring Constructor @Autowired and @Qualifier fails

    Stack Overflow | 3 years ago | Cory Kendall
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'GreatBean' defined in class path resource [config.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [mypackage.MyCoolClass]: No default constructor found; nested exception is java.lang.NoSuchMethodException: mypackage.MyCoolClass.&lt;init&gt;()
  5. 0

    Generic class for controller and service classes in a Spring project

    Stack Overflow | 3 years ago | Kleber Mota
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'controller' defined in file [/home/kleber/apache-tomcat-7.0.42/webapps/blog/WEB-INF/classes/com/config/generic/controller/controller.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.config.generic.controller.controller]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.config.generic.controller.controller.&lt;init&gt;()

  1. ruifung 1 times, last 3 months ago
  2. serious2monkeys 17 times, last 4 months ago
  3. empt-ak 1 times, last 1 month ago
  4. Luka 12 times, last 2 months ago
  5. andyglick 28 times, last 2 months ago
8 more registered users
47 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.NoSuchMethodException

    com.domain.SimpleBean$$EnhancerByCGLIB$$4bc418be.<init>()

    at java.lang.Class.getConstructor0()
  2. Java RT
    Class.getDeclaredConstructor
    1. java.lang.Class.getConstructor0(Unknown Source)
    2. java.lang.Class.getDeclaredConstructor(Unknown Source)
    2 frames
  3. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:65)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
    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:293)
    7. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    10. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    10 frames
  4. Spring Context
    AnnotationConfigApplicationContext.<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.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:75)
    3 frames
  5. com.test
    SpringAnnotationTest.main
    1. com.test.SpringAnnotationTest.main(SpringAnnotationTest.java:12)
    1 frame