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

Spring JIRA | weiersmuller | 9 years 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

    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
  2. 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
  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

    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
  6. 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
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

    com.dexia.sofaxis.caselazyjmx.NotInClassPath

    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:230)
    1 frame
  4. Spring Beans
    DefaultListableBeanFactory.getBeanNamesForType
    1. org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:381)
    2. org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1170)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:479)
    4. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:212)
    5. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:189)
    5 frames
  5. Spring Context
    MBeanExporter.afterPropertiesSet
    1. org.springframework.jmx.export.MBeanExporter.autodetect(MBeanExporter.java:890)
    2. org.springframework.jmx.export.MBeanExporter.autodetectBeans(MBeanExporter.java:863)
    3. org.springframework.jmx.export.MBeanExporter.registerBeans(MBeanExporter.java:496)
    4. org.springframework.jmx.export.MBeanExporter.afterPropertiesSet(MBeanExporter.java:402)
    4 frames
  6. Spring Beans
    AbstractAutowireCapableBeanFactory$1.run
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1288)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1257)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:438)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:383)
    4 frames
  7. Java RT
    AccessController.doPrivileged
    1. java.security.AccessController.doPrivileged(Native Method)
    1 frame
  8. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:353)
    2. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
    3. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169)
    4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
    5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    6. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:400)
    6 frames
  9. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:736)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369)
    2 frames
  10. com.dexia.sofaxis
    TestLazy.realTest
    1. com.dexia.sofaxis.common.test.SofaxisBaseTestCase.getBeanFactory(SofaxisBaseTestCase.java:75)
    2. com.dexia.sofaxis.caselazyjmx.TestLazy.realTest(TestLazy.java:10)
    2 frames
  11. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:585)
    4 frames
  12. JUnit
    JUnit4ClassRunner.run
    1. org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)
    2. org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)
    3. org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)
    4. org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)
    5. org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
    6. org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
    7. org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
    8. org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
    9. org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
    10. org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
    11. org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
    12. org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
    12 frames
  13. JUnit4 Runner
    JUnit4TestReference.run
    1. org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
    1 frame
  14. JUnit3 Runner
    RemoteTestRunner.main
    1. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    5 frames