org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.FileSystemXmlApplicationContext@fb509a: startup date [Fri Jul 17 21:34:24 IST 2015]; root of context hierarchy Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/OrderComparator$OrderSourceProvider at org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:200) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:126) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452) at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:140) at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:84) at mySimpleSpringApp.myApp.main(myApp.java:14) Caused by: java.lang.ClassNotFoundException: org.springframework.core.OrderComparator$OrderSourceProvider 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) ... 7 more
my main class ::
package mySimpleSpringApp;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class myApp {
public static void main(String[] args) {
ApplicationContext appContext = new FileSystemXmlApplicationContext("appContext.xml");
Fruit f = appContext.getBean("fruit", Fruit.class);
Vegetable v = (Vegetable)appContext.getBean("vegetable");
System.out.println(f.talkAboutYourself());
System.out.println(v.talkAboutYourself());
}
}
bean xml file :: appContext.xml::
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="fruit" class="mySimpleSpringApp.Fruit"></bean>
<bean id="vegetable" class="mySimpleSpringApp.Vegetable" />
</beans>
What i am doing wrong here?
This question might be duplicate but i did not get answer from other post, as those solutions did not work for me.