Javatpoint Logo

ClassNotFoundException while running an example(spring) from javatpoint in Eclipse

By: anandk*** On: Thu Jan 21 08:14:41 IST 2016     Question Reputation0 Answer Reputation0 Quiz Belt Series Points2  2Blank User
I am running a sample code given in javatpoint article "http://www.javatpoint.com/spring-JdbcTemplate-tutorial".
While running the example given for eclipse i am getting classNotFoundException while loading ApplicationContext class.

I have attached all the jars in build path,still getting this error.It is so annoying.I have checked many portals for solution, none of them helped.

Following is the error in the eclipse console.

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:159)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:223)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:88)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:58)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at Test.main(Test.java:9)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
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)
... 8 more


Kindly help me.
Up0Down

 
Depends on the Database need to attach jar file Image Created0Down

By: [email protected] On: Sat Mar 19 10:10:24 IST 2016 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :0Yes0No