Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-12392

AspectJ pointcut parser uses initial thread context class loader for resolution - investigate fixes

    XMLWordPrintable

Details

    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    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.

      Attachments

        Activity

          People

            matt@atlassian.com Matt Ryall
            christopher.owen@atlassian.com Christopher Owen [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: