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

AspectJExpressionPointcut does not use the right classloader when initializing the pointcut parser [SPR-7570] #12227

Closed
spring-projects-issues opened this issue Sep 19, 2010 · 3 comments
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

Harald Radi opened SPR-7570 and commented

AspectJExpressionPointcut.initializePointcutParser() calls PointcutParser.getPointcutParserSupportingSpecifiedPrimitivesAndUsingContextClassloaderForResolution() which uses the current thread's context class loader to initialize the pointcut parser's world. the context classloader is never set to the classloader of the current beanfactory though (i'm calling ApplicationContext.refresh() initially).

either the context classloader needs to be set or p.setClassLoader(beanFactory.getClassLoader()) needs to be called somewhere in AspectJExpressionPointcut.


Affects: 3.0.4

Referenced from: commits f88f69e

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch. Fixed for 3.0.5; we're also initializing the PointcutParser lazily now, when actually building the PointcutExpression.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 30, 2010

Harald Radi commented

"we're also initializing the PointcutParser lazily now" - what does that exactly mean? will there then be a separate instance of the PointcutParser per context? that would partially solve #12225 then.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Well, we used to initialize the PointcutParser in AspectJExpressionPointcut's constructor. Now we're doing it in buildPointcutExpression; nothing fancy really, just a bit later in the AspectJExpressionPointcut object's lifecycle. A PointcutParser is still being created individually for ever pointcut expression, like before.

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.5 milestone Jan 11, 2019
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