Hi, I made following changes:
Creating class SpringApplicationContext
Code:
public class SpringApplicationContext implements ApplicationContextAware {
private static ApplicationContext CONTEXT;
public void setApplicationContext(ApplicationContext context) throws BeansException {
CONTEXT = context;
}
public static Object getBean(String beanName) {
return CONTEXT.getBean(beanName);
}
}
And use SpringApplicationContext to create bean:
Code:
JMSSender jmsSender = (JMSSender) SpringApplicationContext.getBean("jmsSender");
Then put ewfspringappl-servlet.xml in WEB-INF and add the following in that:
Code:
<bean id="springApplicationContext" class="com.springexample.client.SpringApplicationContext"/>
And made DispatcherServlet named ewfspringappl in web.xml.
When running the application I got followings errors::
Context initialization failed
The following exception was logged org.springframework.beans.factory.CannotLoadBeanCl assException: Cannot find class [com.springexample.client.SpringApplicationContext] for bean with name 'springApplicationContext' defined in ServletContext resource [/WEB-INF/ewfspringappl-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.springexample.client.SpringApplicationContext
Caused by: java.lang.ClassNotFoundException: com.springexample.client.SpringApplicationContext
How can I remove these errors.
Thanks.