Details
-
Suggestion
-
Resolution: Fixed
-
None
Description
The org.springframework.aop.aspectj.AspectJExpressionPointcut class uses the following factory method for the point cut parser
this.pointcutParser = PointcutParser.getPointcutParserSupportingSpecifiedPrimitivesAndUsingContextClassloaderForResolution(supportedPrimitives);
This means we are stuck with whatever class loader was present at the time that the pointcut expressions are inititialised in Spring. In our case we need to be able to make plugin classes visible to the pointcut parser when it is evaluating whether pointcuts apply to these classes. At the moment we have a fairly nasty workaround in com.atlassian.confluence.setup.ConfluenceBootstrappedContextLoaderListener which feeds the pointcut parser a class loader that we modify later on to delegate to the plugins classloader.
There should be a better way to do this – either by fixing how spring instantiates the pointcut expressions or by making sure that pointcut expressions that do not know about plugin classes are never applied to them.