TL;DR: Is it expected that resources in .jar files included via WebAppContext’s setExtraClasspath method would be loaded in preference to resources with the same name/path within the .war?
——
While doing so, I ran into a problem where one of the .jar files now moved out contains an ehcache.xml file, which seems to be read in preference to the one within the .war when `Thread.currentThread().getContextClassLoader().getResourceAsStream(“ehcache.xml”)` is used.
Now that I know that to be the case, I guess it’s not a big inconvenience to me if I need to rename the file to be unique, but I guess I’m wondering…
- Am I loading the resource incorrectly (and if so, how can I do it to the .war takes priority)?
- Was it only luck that the .war version took precedence previously (when the .jar in question was packed within the .war)?
- Is this an expected drawback of using setExtraClasspath that I just have to live with?
- Did I miss some documentation somewhere which would have clarified this for me?
Many thanks for any pointers,
Matt