aspose file tools*
The moose likes Spring and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException:" Watch "Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException:" New topic
Author

Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException:

satheeshkumar vidadhala
Greenhorn

Joined: Aug 21, 2012
Posts: 1
Hi ,

Can anybody help me out from following issue.i have correctly configured bean.xml and bean class in xml.but i m getting classnotfound exception.. find below log

21 Aug, 2012 8:11:02 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [C:\Users\satheesh kumar\satheesh\softwares\workspace\Springs\src\com\tcs\spring\training\Bean.xml]
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.tcs.training.spring.DemoBean] for bean with name 'Demo' defined in file [C:\Users\satheesh kumar\satheesh\softwares\workspace\Springs\src\com\tcs\spring\training\Bean.xml]; nested exception is java.lang.ClassNotFoundException: com.tcs.training.spring.DemoBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at com.tcs.spring.training.DemoClient.main(DemoClient.java:24)
Caused by: java.lang.ClassNotFoundException: com.tcs.training.spring.DemoBean
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
... 6 more
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Is that the correct class with correct package? then is that class actually in your classpath?

Those to me would be the main reasons why that class is not found.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: