I currently have a configuration file located in my classpath (C:/blah/blah/blah/spring.xml).
I am trying to create an ApplicationContext using the ClassPathXmlApplicationContext in the following manner:
Applicationcontext ctx = new ClassPathXmlApplicationContext("spring.xml");
object = (object) ctx.getBean("MyService_MyAction");
I continued to get an IOException "cannot be opened because it does not exist".
After this, I modified the ClassPathXmlApplicationContext to use ("classpath*:spring.xml"). There is no IOException, but it is unable to create the bean:
"NoSuchBeanDefinitionException: No Bean named 'MyService_MyAction' is defined.
I have been able to load this spring.xml file and bean using the FileSysttemXmlApplicationContext, but I would like to have some more flexibility on where the spring config resides. Are there other options?
Any help on this would be much appreciated.
Thanks!
Will


Reply With Quote