Spring cannot load xml files from jars when wildcards used [SPR-7198] #11857
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Andruschuk Borislav opened SPR-7198 and commented
I use Tomcat 6.0.18 as servlet container and Spring application context cannot be loaded from jar files in unpacked WAR, i.e. when I specified context config locations in web.xml as following Spring-xml files wont be loaded:
<servlet>
<servlet-name>ApplicationServlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/lib/.jar!//ac-.xml classpath*:/ac-*.xml
</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
Spring load xml files which is only in WEB-INF/classes but miss files from WEB-INF/lib.
I've investigated that problem is in org.springframework.web.context.support.ServletContextResourcePatternResolver. I've fix this problem in my own subclass of ResourcePatternResolver and checked this fix redefining standard resolver whith my own via overriden getResourcePatternResolver method in my own implementation of XmlWebApplicationContext. Please see attached file.
Affects: 2.5.5
Attachments:
Referenced from: commits a8ed982
The text was updated successfully, but these errors were encountered: