Skip to content

Spring cannot load xml files from jars when wildcards used [SPR-7198] #11857

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions