I've been working for a while with projects that try to use code from other projects by directly importing them as jars (actually, adding jar maven depeendecies)
Now I'm trying the maven multi-module Roo 1.2 feature.
But if you have a web project and many related application contexts, you can have a problem starting the web application in the server.
In my case, I'm talking about the webmvc-config.xml plus and applicationContext.xml files from other modules with custom applicationContext.xml files to configure them and the applicationContext-security.xml and even some applicationContext.xml with beans for custom security (please, don't judge me, it's due to weird requirements)
What is the problem?
In the web.xml, you can't guarantee the load order with the line:
(Thanks classloader)Code:<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value> </context-param>
What do I do?
I force the load order in the web.xml:
Code:<context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:META-INF/spring/applicationContext-multi-core.xml classpath*:META-INF/spring/applicationContext.xml classpath*:META-INF/spring/applicationContext-custom-security.xml classpath*:META-INF/spring/applicationContext-security.xml </param-value> </context-param>


Reply With Quote