junit.framework.AssertionFailedError: Exception in constructor: testOccupyNonExistingAddress (java.lang.ExceptionInInitializerError

Spring JIRA | Oleksandr Alesinskyy | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I have tried to create bean from nested static public class BooleanFeature of public class: BooleanFeatureStateImpl. <bean class="de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature"> <constructor-arg value="LOCK"/> <property name="configuration" > <props> <prop key="tableName">PLACE</prop> <prop key="stateColumnName">FTR_LOCK</prop> <prop key="assignableTo">PLACE</prop> </props> </property> </bean> With following result: junit.framework.AssertionFailedError: Exception in constructor: testOccupyNonExistingAddress (java.lang.ExceptionInInitializerError at de.ntec.lms.TopologyTest.<init>(TopologyTest.java:18) at de.ntec.lms.impl.topology.PlaceFinderTest.<init>(PlaceFinderTest.java:42) 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:494) at junit.framework.TestSuite.createTest(TestSuite.java:131) at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at junit.framework.TestSuite.<init>(TestSuite.java:75) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature] for bean with name 'de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature' defined in class path resource [context.xml]; nested exception is java.lang.ClassNotFoundException: de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:915) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165) at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:687) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:397) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:330) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at de.ntec.lms.TestContext.<clinit>(TestContext.java:24) ... 15 more Caused by: java.lang.ClassNotFoundException: de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.springframework.util.ClassUtils.forName(ClassUtils.java:177) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:313) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:912) ... 23 more ) at junit.framework.Assert.fail(Assert.java:47) at junit.framework.TestSuite$1.runTest(TestSuite.java:263) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) If I write (for test purposes ) a simlple wrapper around mentioned class package de.ntec.lms.feature; import java.util.Properties; import de.ntec.common.exception.MissingArgumentException; import de.ntec.common.util.SmartPropertiesReader; import de.ntec.lms.DuplicateFeatureException; public class BFC { de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature ftr; public BFC(String id) throws DuplicateFeatureException { ftr= new de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature(id); } public void setConfiguration(Properties cfg) { if (cfg==null) throw new MissingArgumentException("cfg"); ftr.setConfiguration(new SmartPropertiesReader("",cfg)); } } and try to create a bean <bean class="de.ntec.lms.feature.BFC"> <constructor-arg value="LOCK"/> <property name="configuration" > <props> <prop key="tableName">PLACE</prop> <prop key="stateColumnName">FTR_LOCK</prop> <prop key="assignableTo">PLACE</prop> </props> </property> </bean> it runs just fine. Regards, Oleksandr Alesinskyy

    Spring JIRA | 1 decade ago | Oleksandr Alesinskyy
    junit.framework.AssertionFailedError: Exception in constructor: testOccupyNonExistingAddress (java.lang.ExceptionInInitializerError
  2. 0

    I have tried to create bean from nested static public class BooleanFeature of public class: BooleanFeatureStateImpl. <bean class="de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature"> <constructor-arg value="LOCK"/> <property name="configuration" > <props> <prop key="tableName">PLACE</prop> <prop key="stateColumnName">FTR_LOCK</prop> <prop key="assignableTo">PLACE</prop> </props> </property> </bean> With following result: junit.framework.AssertionFailedError: Exception in constructor: testOccupyNonExistingAddress (java.lang.ExceptionInInitializerError at de.ntec.lms.TopologyTest.<init>(TopologyTest.java:18) at de.ntec.lms.impl.topology.PlaceFinderTest.<init>(PlaceFinderTest.java:42) 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:494) at junit.framework.TestSuite.createTest(TestSuite.java:131) at junit.framework.TestSuite.addTestMethod(TestSuite.java:114) at junit.framework.TestSuite.<init>(TestSuite.java:75) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature] for bean with name 'de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature' defined in class path resource [context.xml]; nested exception is java.lang.ClassNotFoundException: de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:915) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165) at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:687) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:397) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:330) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68) at de.ntec.lms.TestContext.<clinit>(TestContext.java:24) ... 15 more Caused by: java.lang.ClassNotFoundException: de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.springframework.util.ClassUtils.forName(ClassUtils.java:177) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:313) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:912) ... 23 more ) at junit.framework.Assert.fail(Assert.java:47) at junit.framework.TestSuite$1.runTest(TestSuite.java:263) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) If I write (for test purposes ) a simlple wrapper around mentioned class package de.ntec.lms.feature; import java.util.Properties; import de.ntec.common.exception.MissingArgumentException; import de.ntec.common.util.SmartPropertiesReader; import de.ntec.lms.DuplicateFeatureException; public class BFC { de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature ftr; public BFC(String id) throws DuplicateFeatureException { ftr= new de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature(id); } public void setConfiguration(Properties cfg) { if (cfg==null) throw new MissingArgumentException("cfg"); ftr.setConfiguration(new SmartPropertiesReader("",cfg)); } } and try to create a bean <bean class="de.ntec.lms.feature.BFC"> <constructor-arg value="LOCK"/> <property name="configuration" > <props> <prop key="tableName">PLACE</prop> <prop key="stateColumnName">FTR_LOCK</prop> <prop key="assignableTo">PLACE</prop> </props> </property> </bean> it runs just fine. Regards, Oleksandr Alesinskyy

    Spring JIRA | 1 decade ago | Oleksandr Alesinskyy
    junit.framework.AssertionFailedError: Exception in constructor: testOccupyNonExistingAddress (java.lang.ExceptionInInitializerError
  3. 0

    SpringFramework and DbUnit integration test class not found AnnotationBeanConfigurerAspect Java

    Stack Overflow | 1 year ago | RockOrDead
    org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean with name 'org.springframework.context.config.internalBeanConfigurerAspect' defined in null; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    With Spring 2.0.3 the following bean definitions did not cause error to be thrown, lazy is honnored : {code:xml} <bean class="com.dexia.sofaxis.caselazyjmx.JMXBean" lazy-init="true"> <property name="dummy" ref="dummy"/> </bean> <bean id="dummy" class="com.dexia.sofaxis.caselazyjmx.NotInClassPath" lazy-init="true"> </bean> <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"> <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER" /> <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" /> <property name="namingStrategy"> <bean class="org.springframework.jmx.export.naming.MetadataNamingStrategy"> <property name="attributeSource"> <ref local="attributeSource" /> </property> </bean> </property> <property name="assembler"> <bean class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler"> <property name="attributeSource"> <ref local="attributeSource" /> </property> </bean> </property> </bean> <bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" /> {code} with com.dexia.sofaxis.caselazyjmx.JMXBean.java = {code} @ManagedResource(objectName = "sofaxis:name=JMXLazyBean", description = "JMXLazyBean") public class JMXBean { public JMXBean() { } public void setDummy(Object o) { } } {code} When upgrading to 2.5 the following exception is thrown : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [tests-beanDef.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at com.dexia.sofaxis.common.test.SofaxisBaseTestCase.getBeanFactory(SofaxisBaseTestCase.java:75) at com.dexia.sofaxis.caselazyjmx.TestLazy.realTest(TestLazy.java:10) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1173) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:479) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:212) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:189) at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:890) at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:863) at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:496) at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:402) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257) ... 35 more Caused by: java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.springframework.util.ClassUtils.forName(ClassUtils.java:230) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:381) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1170) ... 44 more => lazy is no more honnored.

    Spring JIRA | 9 years ago | weiersmuller
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [tests-beanDef.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath
  6. 0

    With Spring 2.0.3 the following bean definitions did not cause error to be thrown, lazy is honnored : {code:xml} <bean class="com.dexia.sofaxis.caselazyjmx.JMXBean" lazy-init="true"> <property name="dummy" ref="dummy"/> </bean> <bean id="dummy" class="com.dexia.sofaxis.caselazyjmx.NotInClassPath" lazy-init="true"> </bean> <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter"> <property name="autodetectModeName" value="AUTODETECT_ASSEMBLER" /> <property name="registrationBehaviorName" value="REGISTRATION_REPLACE_EXISTING" /> <property name="namingStrategy"> <bean class="org.springframework.jmx.export.naming.MetadataNamingStrategy"> <property name="attributeSource"> <ref local="attributeSource" /> </property> </bean> </property> <property name="assembler"> <bean class="org.springframework.jmx.export.assembler.MetadataMBeanInfoAssembler"> <property name="attributeSource"> <ref local="attributeSource" /> </property> </bean> </property> </bean> <bean id="attributeSource" class="org.springframework.jmx.export.annotation.AnnotationJmxAttributeSource" /> {code} with com.dexia.sofaxis.caselazyjmx.JMXBean.java = {code} @ManagedResource(objectName = "sofaxis:name=JMXLazyBean", description = "JMXLazyBean") public class JMXBean { public JMXBean() { } public void setDummy(Object o) { } } {code} When upgrading to 2.5 the following exception is thrown : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [tests-beanDef.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1260) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at com.dexia.sofaxis.common.test.SofaxisBaseTestCase.getBeanFactory(SofaxisBaseTestCase.java:75) at com.dexia.sofaxis.caselazyjmx.TestLazy.realTest(TestLazy.java:10) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1173) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:479) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:212) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:189) at org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:890) at org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:863) at org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:496) at org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:402) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257) ... 35 more Caused by: java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.springframework.util.ClassUtils.forName(ClassUtils.java:230) at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:381) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1170) ... 44 more => lazy is no more honnored.

    Spring JIRA | 9 years ago | weiersmuller
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mbeanExporter' defined in class path resource [tests-beanDef.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.dexia.sofaxis.caselazyjmx.NotInClassPath] for bean with name 'dummy' defined in class path resource [tests-beanDef.xml]; nested exception is java.lang.ClassNotFoundException: com.dexia.sofaxis.caselazyjmx.NotInClassPath

  1. Andreas Häber 25 times, last 3 weeks ago
  2. batwalrus76 3 times, last 2 months ago
  3. kid 84 times, last 11 months ago
  4. iferca 3 times, last 2 weeks ago
  5. andyglick 1 times, last 2 weeks ago
68 more registered users
27 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

    de.ntec.lms.impl.feature.BooleanFeatureStateImpl.BooleanFeature

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    5. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    6. java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    6 frames
  3. Spring Core
    ClassUtils.forName
    1. org.springframework.util.ClassUtils.forName(ClassUtils.java:177)
    1 frame
  4. Spring Beans
    DefaultListableBeanFactory.getBeanNamesForType
    1. org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:313)
    2. org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:912)
    3. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165)
    3 frames
  5. Spring Context
    ClassPathXmlApplicationContext.<init>
    1. org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:687)
    2. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:397)
    3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:330)
    4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:92)
    5. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:77)
    6. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:68)
    6 frames
  6. de.ntec.lms
    PlaceFinderTest.<init>
    1. de.ntec.lms.TestContext.<clinit>(TestContext.java:24)
    2. de.ntec.lms.TopologyTest.<init>(TopologyTest.java:18)
    3. de.ntec.lms.impl.topology.PlaceFinderTest.<init>(PlaceFinderTest.java:42)
    3 frames
  7. 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:494)
    4 frames
  8. JUnit
    TestSuite.<init>
    1. junit.framework.TestSuite.createTest(TestSuite.java:131)
    2. junit.framework.TestSuite.addTestMethod(TestSuite.java:114)
    3. junit.framework.TestSuite.<init>(TestSuite.java:75)
    3 frames
  9. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
    2. org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:59)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    6. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    6 frames