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

AnnotationSessionFactoryBean packagesToScan in a OSGi environment [SPR-6042] #10711

Closed
spring-projects-issues opened this issue Aug 25, 2009 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 25, 2009

Nicolas Cornaglia opened SPR-6042 and commented

The code

String pattern = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
    ClassUtils.convertClassNameToResourcePath(pkg) + RESOURCE_PATTERN;

in the AnnotationSessionFactoryBean.scanPackages() method resolves the pattern to scan to classpath:com/mycompany**/.class for a packagesToScan="com/mycompany", but it fails to get the resources. I think a slash is missing to obtain classpath:com/mycompany//.class**, like the one in ClassPathScanningCandidateComponentProvider.findCandidateComponents():

String packageSearchPath = ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX +
    resolveBasePackage(basePackage) + "/" + this.resourcePattern;

or at least a setResourcePattern() like ClassPathScanningCandidateComponentProvider.


Affects: 2.5.6

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

This has fortunately already been addressed in the 3.0 branch. Feel free to give a recent milestone a try...

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) status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants