aspose file tools*
The moose likes Spring and the fly likes Error registering bean And Classnotfound Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Error registering bean And Classnotfound Exception" Watch "Error registering bean And Classnotfound Exception" New topic
Author

Error registering bean And Classnotfound Exception

santosh goud
Greenhorn

Joined: Dec 10, 2011
Posts: 6
Can any one help me out with this.

Dec 15, 2011 7:27:27 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\Users\Santosh\Documents\SpringWorkSpace\SpringDAO\mybeans.xml]
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in file [C:\Users\Santosh \Documents\SpringWorkSpace\SpringDAO\mybeans.xml]: Class that bean class [org.apache.commons.dbcp.BasicDataSource] depends on not found; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:87)
at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:62)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:362)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitionElement(DefaultXmlBeanDefinitionParser.java:328)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseBeanDefinitions(DefaultXmlBeanDefinitionParser.java:265)
at org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:185)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:238)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:155)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:99)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:103)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:71)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:87)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:262)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:82)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:58)
at spring.example4.InsertCustomerTest.main(InsertCustomerTest.java:8)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.pool.impl.GenericObjectPool
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 19 more

Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
I think you need commons-pool jar

http://commons.apache.org/pool/
santosh goud
Greenhorn

Joined: Dec 10, 2011
Posts: 6
thanks it worked.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error registering bean And Classnotfound Exception