org.springframework.beans.factory.BeanCreationException

Error creating bean with name 'poolConfig' defined in class path resource [app.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net.sourceforge.cobertura.coveragedata.TouchCollector

Samebug tips8

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.

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.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web19378

  • Error creating bean with name 'poolConfig' defined in class path resource [app.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net.sourceforge.cobertura.coveragedata.TouchCollector
  • Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
  • Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/PoolConfig
  • Stack trace

    • org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'poolConfig' defined in class path resource [app.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net.sourceforge.cobertura.coveragedata.TouchCollector at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1105) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1050) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at cn.com.so.Myredistest.App.main(App.java:25) Caused by: java.lang.NoClassDefFoundError: net.sourceforge.cobertura.coveragedata.TouchCollector at org.apache.commons.pool2.impl.BaseObjectPoolConfig.__cobertura_init(BaseObjectPoolConfig.java) at org.apache.commons.pool2.impl.BaseObjectPoolConfig.<clinit>(BaseObjectPoolConfig.java) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:88) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098) ... 13 more Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.TouchCollector at java.net.URLClassLoader.findClass(URLClassLoader.java:606) at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:792) at java.lang.ClassLoader.loadClass(ClassLoader.java:766) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:325) at java.lang.ClassLoader.loadClass(ClassLoader.java:747)

    Write tip

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

    Users with the same issue

    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    Unknown user
    Once, 1 year ago
    17 times, 3 days ago
    2 times, 3 days ago
    2420 more bugmates