Announcement Announcement Module
Collapse
No announcement yet.
How to aop @WebService? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to aop @WebService?

    Hi,

    I want to intercept a class with a @WebService annotation.
    I want to expose the webservice with the JDK6 build in HTTP server.

    But the generated proxy seems to lose the annotation:

    Code:
    Caused by: java.lang.NullPointerException
    	at com.sun.xml.internal.ws.server.EndpointFactory.getWsdlLocation(EndpointFactory.java:385)
    	at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.getPrimaryWsdl(EndpointImpl.java:265)
    	at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
    	at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:147)
    	at org.springframework.remoting.jaxws.SimpleHttpServerJaxWsServiceExporter.publishEndpoint(SimpleHttpServerJaxWsServiceExporter.java:175)
    I already tried <aop:config proxy-target-class="true">, does not help...

    What can I do?

    Thank you

  • #2
    What you are observing is unfortunately the expected behavior. JDK proxies do not carry the annotations from the target class (in fact, they don't even have the concept of the target class) nor do CGLIB proxies (perhaps a good thing for symmetry with JDK proxies).

    Could you use AspectJ weaving? If so, since no proxies are involved in that setup, you will get the desired effect.

    -Ramnivas

    Comment


    • #3
      OK, AspectJ would be the way.
      How does it interfere with Spring AOP (proxy and CGLIB)?

      Comment


      • #4
        Please can anyone explain this better?

        Hi,

        I'm getting the same problem. Can anyone please give a full detailed explanation. To give some context, I've no idea what AspectJ weaving is...

        Thanks,

        Alex

        Comment

        Working...
        X