Skip to content

sws:annotation-driven does not pick up @Endpoint annotations on classes that are JDK proxies [SWS-702] #798

@gregturn

Description

@gregturn

Erwin Vervaet opened SWS-702 and commented

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 #419


Affects: 2.0.1

Referenced from: commits 279daae, cc73683, bd62e54

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions