Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11910

@Async isn't applied, if the interface doesn't have concrete implementation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.0.5
    • Fix Version/s: 4.0.6, 4.1 RC1
    • Component/s: Core:AOP
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      If we add @Async fo the interface method, but don't provide an implementation for the interface, we and end up with issue, when @Async can't be applied and java.lang.IllegalArgumentException: Class must not be null is thrown.

      Can't we use the same AutoProxyRegistrar technique for @Async as it is for @Transactional?
      I mean build a new Proxy independently of target bean state.

      I understand that AsyncExecutionAspectSupport should be the first one in the chain, but it looks like we have a limitation on the matter, if we don't provide a real implementation for our annotated interface.

      The Spring Integration infrastructure just creates proxy fo the provided interface and that's all.

      See linked issue INT-3448

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              abilan Artem Bilan
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 30 weeks, 1 day ago