-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
David Ward opened SPR-6411 and commented
At alfresco, we have a large number of spring bean files containing wildcard imports such as this
<beans>
<import resource="classpath*:alfresco/module-context.xml" />
<import resource="classpath*:alfresco/enterprise/*-context.xml"/>
</beans>
Unfortunately, this no longer works with Spring 3.0 RC2.
I have tracked down the problem to
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(Element)
and have successfully fixed the issue in my own subclass with the following change
// Discover whether the location is an absolute or relative URI
boolean absoluteLocation = false;
try
{
absoluteLocation = location.startsWith(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX) // ADDED THIS LINE
|| ResourceUtils.toURI(location).isAbsolute();
}
catch (Exception ex)
{
// cannot convert to an URI, considering the location relative
}
Affects: 3.0 RC2
Issue Links:
- Cannot import bean definitions using classpath*: resource location [SPR-6366] #11032 Cannot import bean definitions using classpath*: resource location ("duplicates")
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug