junit.framework.AssertionFailedError

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.

tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

Check if you didn't forget to instantiate your topic in the kafka broker.

tip

NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.

tip

You need to add httpcore to your dependencies. Try adding version 4.3 or further.

tip

You might've forgot to add a dependency or it's written wrong. Also, you might be using incompatible versions of Java and Hibernate. More on this here: https://goo.gl/SjSlRA

tip

This error means there's a class missing in your classpath during runtime. You need to create a jar with all your dependencies and have it in your classpath. Check Maven Assembly Plugin and how to add your dependencies to a jar: https://goo.gl/U2zr8k

tip

jsp-api and servlet-api jars must NOT be deployed by your web app. They should be marked as provided but not deployed by your app.

tip

The server rejects all jars that already belong to the server runtime (such as tomcat-**.jar, servlet**.jar). Consider substituting the CORS filter you're using for this one: https://goo.gl/ctQ7Fs

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • 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
    via by Oleksandr Alesinskyy,
  • 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
    via by Oleksandr Alesinskyy,
  • 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.
    via by weiersmuller,
  • 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.
    via by weiersmuller,
  • Re: Problem with ipf-archtype-basic
    via by Boris Stanojević,
  • Bean Creation Exception with JBoss 5.1.2
    via Stack Overflow by ajit kumar
    ,
    • 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

    Users with the same issue

    Andreas Häber
    101 times, last one,
    stigkj
    1 times, last one,
    Axelo
    8 times, last one,
    marcbouvierdav
    26 times, last one,
    Unknown visitor1 times, last one,
    2285 more bugmates