jersey
  1. jersey
  2. JERSEY-2301

Spring beans with AOP are not proxied in Jersey 2 using HK2/Spring Bridge

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: extensions
    • Labels:
    • Environment:

      OS X 10.8

    • Tags:
    • Sprint:
      Team Drosera

      Description

      We recently ported our application from Jersey 1 to Jersey 2. We are leveraging the Spring support provided by Jersey/HK2 via the Spring Bridge. Our REST Resources have Spring AOP applied to them (Logging, Profiling, etc). This worked fine in Jersey 1. After porting to Jersey 2 (with the switch to HK2), our REST Resources are no longer proxied AOP classes. Example:

      @Logging
      @Profile
      @Named
      @Path("customers")
      public class CustomersResource {
      ...
      }
      

        Activity

        Hide
        emilesvt added a comment -

        I should comment that AOP works fine throughout the rest of our Spring beans, it's only on the REST resources that AOP is missing.

        Show
        emilesvt added a comment - I should comment that AOP works fine throughout the rest of our Spring beans, it's only on the REST resources that AOP is missing.
        Hide
        jwells added a comment -

        I think this is a jersey issue and not an HK2 issue, so I've moved it to the Jersey Jira product.

        Show
        jwells added a comment - I think this is a jersey issue and not an HK2 issue, so I've moved it to the Jersey Jira product.
        Hide
        ccronemberger added a comment -

        Here is a workaround:

        http://stackoverflow.com/a/24554236/1071971

        The idea is to let Spring create the beans (that will be proxied) and then register them in Jersey. It depends on another fix as mentioned in the link.

        Show
        ccronemberger added a comment - Here is a workaround: http://stackoverflow.com/a/24554236/1071971 The idea is to let Spring create the beans (that will be proxied) and then register them in Jersey. It depends on another fix as mentioned in the link.
        Hide
        Adam Lindenthal added a comment -

        The pull request by ccronemberger was merged (thank you). It should provide a workaround for this issue.
        https://github.com/jersey/jersey/pull/90

        Show
        Adam Lindenthal added a comment - The pull request by ccronemberger was merged (thank you). It should provide a workaround for this issue. https://github.com/jersey/jersey/pull/90
        Hide
        Stepan Vavra added a comment -

        The PR provided a workaround. We do not plan to dedicate additional resources to fixing the issue fully at the moment. In case you feel strongly about the issue, please consider contributing a fix by submitting a Github pull request.

        Show
        Stepan Vavra added a comment - The PR provided a workaround. We do not plan to dedicate additional resources to fixing the issue fully at the moment. In case you feel strongly about the issue, please consider contributing a fix by submitting a Github pull request.

          People

          • Assignee:
            Unassigned
            Reporter:
            emilesvt
          • Votes:
            5 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile