org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0' defined in URL [bundleentry://32/META-INF/spring/swing-forms.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

Spring JIRA | Hendy Irawan | 9 years ago
  1. 0

    Running my project with Spring-DM 1.1.0-m2 gives the following error. Using Spring-DM 1.0.2 solves the problem, so this is a regression. [SpringOsgiExtenderThread-4] ERROR org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor - Unable to create application context for [com.x.client.swing.forms], unsatisfied dependencies: none org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0' defined in URL [bundleentry://32/META-INF/spring/swing-forms.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:881) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837) 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:220) 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.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:579) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:221) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:218) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:131) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:674) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:111) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:875) ... 17 more Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.<init>(CommonAnnotationBeanPostProcessor.java:186) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96) ... 19 more Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:434) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ... 25 more [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor - Completing refresh for OsgiBundleXmlApplicationContext(bundle=com.x.x.db.inmemory, config=osgibundle:/META-INF/spring/*.xml) [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@15b0e2c] [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@ff9053] [SpringOsgiExtenderThread-5] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@111ded2: defining beans [org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,ruleDb,org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0]; root of factory hierarchy [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' to allow for resolving potential circular references [SpringOsgiExtenderThread-5] TRACE org.springframework.beans.CachedIntrospectionResults - Getting BeanInfo for class [org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean]

    Spring JIRA | 9 years ago | Hendy Irawan
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0' defined in URL [bundleentry://32/META-INF/spring/swing-forms.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
  2. 0

    Running my project with Spring-DM 1.1.0-m2 gives the following error. Using Spring-DM 1.0.2 solves the problem, so this is a regression. [SpringOsgiExtenderThread-4] ERROR org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor - Unable to create application context for [com.x.client.swing.forms], unsatisfied dependencies: none org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0' defined in URL [bundleentry://32/META-INF/spring/swing-forms.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:881) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837) 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:220) 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.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:579) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:221) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:218) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:131) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:674) at java.lang.Thread.run(Thread.java:619) Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:111) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:875) ... 17 more Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.<init>(CommonAnnotationBeanPostProcessor.java:186) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96) ... 19 more Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:434) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) ... 25 more [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor - Completing refresh for OsgiBundleXmlApplicationContext(bundle=com.x.x.db.inmemory, config=osgibundle:/META-INF/spring/*.xml) [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@15b0e2c] [SpringOsgiExtenderThread-5] DEBUG org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@ff9053] [SpringOsgiExtenderThread-5] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@111ded2: defining beans [org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,ruleDb,org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0]; root of factory hierarchy [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.context.annotation.internalRequiredAnnotationProcessor' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' [SpringOsgiExtenderThread-5] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean#0' to allow for resolving potential circular references [SpringOsgiExtenderThread-5] TRACE org.springframework.beans.CachedIntrospectionResults - Getting BeanInfo for class [org.springframework.osgi.service.exporter.support.OsgiServiceFactoryBean]

    Spring JIRA | 9 years ago | Hendy Irawan
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotation.CommonAnnotationBeanPostProcessor#0' defined in URL [bundleentry://32/META-INF/spring/swing-forms.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.annotation.CommonAnnotationBeanPostProcessor]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
  3. 0

    Spring-DM 1.1.0-m2 Error -- java.lang.NoClassDefFoundError: javax/annotation/PostConstruct

    Google Groups | 9 years ago | Hendy Irawan
    java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    eclipse plug-in dependencies and classnotfoundexception

    Stack Overflow | 7 years ago
    java.lang.ClassNotFoundException: org.eclipse.ui.console.MessageConsole

    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

      javax.annotation.PostConstruct

      at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal()
    2. Eclipse OSGi
      DefaultClassLoader.loadClass
      1. org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:434)
      2. org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
      3. org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
      4. org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
      4 frames
    3. Java RT
      ClassLoader.loadClassInternal
      1. java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      2. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      2 frames
    4. Spring Context
      CommonAnnotationBeanPostProcessor.<init>
      1. org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.<init>(CommonAnnotationBeanPostProcessor.java:186)
      1 frame
    5. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      4 frames
    6. Spring Beans
      AbstractAutowireCapableBeanFactory$1.run
      1. org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96)
      2. org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:875)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
      6. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      6 frames
    7. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    8. Spring Beans
      AbstractBeanFactory.getBean
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      2. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      3. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      6 frames
    9. Spring Context
      AbstractApplicationContext.registerBeanPostProcessors
      1. org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:579)
      1 frame
    10. Spring OSGi Core
      AbstractDelegatedExecutionApplicationContext.startRefresh
      1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:221)
      1 frame
    11. org.springframework.osgi
      DependencyWaiterApplicationContextExecutor.refresh
      1. org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:218)
      2. org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)
      2 frames
    12. Spring OSGi Core
      AbstractDelegatedExecutionApplicationContext.refresh
      1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:131)
      1 frame
    13. org.springframework.osgi
      ContextLoaderListener$2.run
      1. org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:674)
      1 frame
    14. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:619)
      1 frame