Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Cannot import XML bean documents using classpath*: pseudo URLs [SPR-6411] #11077

Closed
spring-projects-issues opened this issue Nov 23, 2009 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 23, 2009

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:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This should be fixed in the latest snapshots already.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants