Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-702

sws:annotation-driven does not pick up @Endpoint annotations on classes that are JDK proxies

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Core
    • Labels:
      None
    • Environment:
      SWS 2.0.1.RELEASE

      Description

      We essentially have an app context loaded by the MessageDispatcherServlet that does the following:

      <bean id="ws.myWebService" class="foo.bar.MyWebServiceImpl"/>
      <aop:aspectj-autoproxy />
      <bean class="foo.bar.MyCustomAspect"/>
      <sws:annotation-driven/>

      The MyWebServiceImpl looks like this:

      @Endpoint
      public class MyWebServiceImpl implements MyWebService {
       
        @PayloadRoot(namespace = "http://my.foo.bar", localPart = "myWebService")
        @MyCustomAnnotation // picked up by MyCustomAspect to proxy this class
        @ResponsePayload
        public MyResponseDocument getFactInfo(@RequestPayload MyRequestDocument request) {
          ...
        }
      }

      As a result of the @MyCustomAnnotation, the MyWebServiceImpl will be JDK proxied. Because of this the @Endpoint is not picked up. If we remove the custom aspect the @Endpoint is indeed picked up.

      For now, I have added the following to the app context as a workaround:

      <aop:config proxy-target-class="true"/>

      Note that this seems to be similar to SWS-262

        Activity

        klr8 Erwin Vervaet created issue -
        klr8 Erwin Vervaet made changes -
        Field Original Value New Value
        Assignee Arjen Poutsma [ arjen.poutsma ]
        klr8 Erwin Vervaet made changes -
        Component/s Core [ 10150 ]
        Affects Version/s 2.0.1 [ 11810 ]
        arjen.poutsma Arjen Poutsma made changes -
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.0.2 [ 11893 ]
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Description We essentially have an app context loaded by the MessageDispatcherServlet that does the following:

        <bean id="ws.myWebService" class="foo.bar.MyWebServiceImpl"/>
        <aop:aspectj-autoproxy />
        <bean class="foo.bar.MyCustomAspect"/>
        <sws:annotation-driven/>

        The MyWebServiceImpl looks like this:

        @Endpoint
        public class MyWebServiceImpl implements MyWebService {

          @PayloadRoot(namespace = "http://my.foo.bar", localPart = "myWebService")
          @MyCustomAnnotation // picked up by MyCustomAspect to proxy this class
          @ResponsePayload
          public MyResponseDocument getFactInfo(@RequestPayload MyRequestDocument request) {
            ...
          }
        }

        As a result of the @MyCustomAnnotation, the MyWebServiceImpl will be JDK proxies. Because of this the @Endpoint is not picked up. If we remove the custom aspect the @Endpoint is indeed picked up.

        For now, I have added the following to the app context as a workaround:
        <aop:config proxy-target-class="true"/>

        Note that this seems to be similar to SWS-262
        We essentially have an app context loaded by the MessageDispatcherServlet that does the following:

        {code:xml}
        <bean id="ws.myWebService" class="foo.bar.MyWebServiceImpl"/>
        <aop:aspectj-autoproxy />
        <bean class="foo.bar.MyCustomAspect"/>
        <sws:annotation-driven/>
        {code}

        The MyWebServiceImpl looks like this:

        {code}
        @Endpoint
        public class MyWebServiceImpl implements MyWebService {

          @PayloadRoot(namespace = "http://my.foo.bar", localPart = "myWebService")
          @MyCustomAnnotation // picked up by MyCustomAspect to proxy this class
          @ResponsePayload
          public MyResponseDocument getFactInfo(@RequestPayload MyRequestDocument request) {
            ...
          }
        }
        {code}

        As a result of the @MyCustomAnnotation, the MyWebServiceImpl will be JDK proxies. Because of this the @Endpoint is not picked up. If we remove the custom aspect the @Endpoint is indeed picked up.

        For now, I have added the following to the app context as a workaround:
        {code:xml}
        <aop:config proxy-target-class="true"/>
        {code}

        Note that this seems to be similar to SWS-262
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        arjen.poutsma Arjen Poutsma made changes -
        Time Spent 17m [ 1020 ]
        Worklog Id 28122 [ 28122 ]
        Remaining Estimate 0d [ 0 ]
        klr8 Erwin Vervaet made changes -
        Description We essentially have an app context loaded by the MessageDispatcherServlet that does the following:

        {code:xml}
        <bean id="ws.myWebService" class="foo.bar.MyWebServiceImpl"/>
        <aop:aspectj-autoproxy />
        <bean class="foo.bar.MyCustomAspect"/>
        <sws:annotation-driven/>
        {code}

        The MyWebServiceImpl looks like this:

        {code}
        @Endpoint
        public class MyWebServiceImpl implements MyWebService {

          @PayloadRoot(namespace = "http://my.foo.bar", localPart = "myWebService")
          @MyCustomAnnotation // picked up by MyCustomAspect to proxy this class
          @ResponsePayload
          public MyResponseDocument getFactInfo(@RequestPayload MyRequestDocument request) {
            ...
          }
        }
        {code}

        As a result of the @MyCustomAnnotation, the MyWebServiceImpl will be JDK proxies. Because of this the @Endpoint is not picked up. If we remove the custom aspect the @Endpoint is indeed picked up.

        For now, I have added the following to the app context as a workaround:
        {code:xml}
        <aop:config proxy-target-class="true"/>
        {code}

        Note that this seems to be similar to SWS-262
        We essentially have an app context loaded by the MessageDispatcherServlet that does the following:

        {code:xml}
        <bean id="ws.myWebService" class="foo.bar.MyWebServiceImpl"/>
        <aop:aspectj-autoproxy />
        <bean class="foo.bar.MyCustomAspect"/>
        <sws:annotation-driven/>
        {code}

        The MyWebServiceImpl looks like this:

        {code}
        @Endpoint
        public class MyWebServiceImpl implements MyWebService {

          @PayloadRoot(namespace = "http://my.foo.bar", localPart = "myWebService")
          @MyCustomAnnotation // picked up by MyCustomAspect to proxy this class
          @ResponsePayload
          public MyResponseDocument getFactInfo(@RequestPayload MyRequestDocument request) {
            ...
          }
        }
        {code}

        As a result of the @MyCustomAnnotation, the MyWebServiceImpl will be JDK proxied. Because of this the @Endpoint is not picked up. If we remove the custom aspect the @Endpoint is indeed picked up.

        For now, I have added the following to the app context as a workaround:
        {code:xml}
        <aop:config proxy-target-class="true"/>
        {code}

        Note that this seems to be similar to SWS-262
        klr8 Erwin Vervaet made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Cannot Reproduce [ 5 ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.0.2 [ 11893 ]
        Fix Version/s 2.0.3 [ 12197 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Reopened [ 4 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Worklog Id 28437 [ 28437 ]
        Time Spent 17m [ 1020 ] 4h 20m [ 15600 ]
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            klr8 Erwin Vervaet
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 4h 20m
              4h 20m