-
1. Re: ModuleClassLoader for WAR only sees WEB-INF/lib and WEB-INF/classes (no "resources") ?
robby.cornelissen May 16, 2013 11:59 PM (in response to drh01)Which object are you calling getResource() on? The ServletContext?
-
2. Re: ModuleClassLoader for WAR only sees WEB-INF/lib and WEB-INF/classes (no "resources") ?
drh01 May 17, 2013 12:02 AM (in response to robby.cornelissen)getResource() is being called on the ModuleClassLoader, where the module is the war deployment. (Note, I am not calling getResource directly, this is framework code that ends up calling it -- but in the debugger I have verified that it is the ModuleClassLoader for the war deployment being used).
-
3. Re: ModuleClassLoader for WAR only sees WEB-INF/lib and WEB-INF/classes (no "resources") ?
sfcoy May 17, 2013 3:37 AM (in response to drh01)WEB-INF is not part of the classpath. JBossAS/WildFly is behaving correctly.
In order for the Spring Framework to find your configuration files you must set the contextConfigLocation context-param in your web.xml file:
{code:xml} <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beanRefContext.xml</param-value>
</context-param>{code}
-
4. Re: ModuleClassLoader for WAR only sees WEB-INF/lib and WEB-INF/classes (no "resources") ?
drh01 May 17, 2013 9:29 PM (in response to sfcoy)Thanks Stephen. I didn't really suspect a JBoss bug here, I assumed it was misconfiguration or something I was just missing.
As an aside, contextConfigLocation doesn't come into play in my scenario; ContextListenerLoader also has an option to specify a parent context which is loaded through the classloader -- this is what I was working with (presumably contextConfigLocation is loaded using ServletContext).
Thanks again for the clarification.
Stephen Coy wrote:
WEB-INF is not part of the classpath. JBossAS/WildFly is behaving correctly.
In order for the Spring Framework to find your configuration files you must set the contextConfigLocation context-param in your web.xml file:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/beanRefContext.xml</param-value> </context-param>