I think I am missing the point on something basic. Would somebody enlighten me?
I would like to read a custom bean that I added to the cxf/spring context file.
What is the correct syntax for reading it?
My configuration:
a) In web.xml:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
b) Context files:
WEB-INF/applicationContext-ws.xml (for the web service)
WEB-INF/classes/applicationContext-app.xml (for other beans)
c) Loading beans from applicationContext-app.xml (works OK):
ApplicationContext ctx = new ClassPathXmlApplicationContext(
"applicationContext-app.xml" );
myBean = (MyBeanClass)ctx.getBean("myBean");
d) Loading beans from applicationContext-ws.xml does not work. I tried:
- similar code to that in (c)
- autowiring
- using the ServletContextAware interface (crazy idea of course - CXF is not
Spring MVC)
Any help will be greatly welcome... I know this must be terribly basic and I am
feeling really stupid.