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

@Endpoint with method having any other annotation then @PayloadRoot is not mapped

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4
    • Component/s: Core
    • Labels:
      None
    • Environment:
      spring 2.5.5, spring-ws 1.5.3, spring-security 2.0.3

      Description

      I've got @PayloadRoot annotated methods of @Endpoint and some methods also has @RolesAllowed from spring security. Today after upgrading from spring-ws 1.5.2 PayloadRootAnnotationMethodEndpointMapping stopped to processed this endpoint. I've also tried another (my custom @Log AOP annotation) annotation with same (bad) result.
      So now after last test, when any @Endpoint method has any other annotation then @PayloadRoot, it is not mapped.

        Activity

        anthavio Martin Vanek created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Fix Version/s 1.5.4 [ 11016 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I am having issues trying to reproduce this

        Could you please attach an application context that reproduces this issue, or (better yet) a test case?

        Thanks

        Show
        arjen.poutsma Arjen Poutsma added a comment - I am having issues trying to reproduce this Could you please attach an application context that reproduces this issue, or (better yet) a test case? Thanks
        Hide
        anthavio Martin Vanek added a comment -

        Got it. It is because AOP.
        When Endpoint method is like:
        @Log
        @PayloadRoot(localPart = "controlBatch", namespace = "http://www.komix.cz/sis/nssis/internal/types")
        public ControlBatchResponse controlBatch(ControlBatch in)

        { System.err.println("controlBatch " + in); return new ControlBatchResponse(); }

        and spring configuration contains
        <aop:aspectj-autoproxy/>
        <aop:config>

        <aop:aspect ref="Log4jAspect">
        <aop:pointcut id="loggedMethodPointcut" expression="@annotation(test.Log) and @annotation(log)"/>
        <aop:around pointcut-ref="loggedMethodPointcut" method="log"/>
        </aop:aspect>

        </aop:config>
        <bean id="Log4jAspect" class="test.Log4jAspect"/>

        then mapping works in 1.5.2 but not in 1.5.3.
        When I comment out aop configuration or remove @Log annotation from method, it works in both versions.

        Show
        anthavio Martin Vanek added a comment - Got it. It is because AOP. When Endpoint method is like: @Log @PayloadRoot(localPart = "controlBatch", namespace = "http://www.komix.cz/sis/nssis/internal/types") public ControlBatchResponse controlBatch(ControlBatch in) { System.err.println("controlBatch " + in); return new ControlBatchResponse(); } and spring configuration contains <aop:aspectj-autoproxy/> <aop:config> <aop:aspect ref="Log4jAspect"> <aop:pointcut id="loggedMethodPointcut" expression="@annotation(test.Log) and @annotation(log)"/> <aop:around pointcut-ref="loggedMethodPointcut" method="log"/> </aop:aspect> </aop:config> <bean id="Log4jAspect" class="test.Log4jAspect"/> then mapping works in 1.5.2 but not in 1.5.3. When I comment out aop configuration or remove @Log annotation from method, it works in both versions.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Ok, thanks for that. This information really helps .

        Show
        arjen.poutsma Arjen Poutsma added a comment - Ok, thanks for that. This information really helps .
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I still can't reproduce this bug. I've created a sample logging aspect as part of the PayloadRootAnnotationMethodEndpointMappingTest, and all works fine. You can find it here:
        https://springframework.svn.sourceforge.net/svnroot/springframework/spring-ws/trunk/core-tiger/src/test/java/org/springframework/ws/server/endpoint/mapping/
        https://springframework.svn.sourceforge.net/svnroot/springframework/spring-ws/trunk/core-tiger/src/test/resources/org/springframework/ws/server/endpoint/mapping/

        Could you please check out the source of Spring-WS (see http://static.springframework.org/spring-ws/sites/1.5/source-repository.html), and look at the tests of the core-tiger module, to see what I'm missing?

        Show
        arjen.poutsma Arjen Poutsma added a comment - I still can't reproduce this bug. I've created a sample logging aspect as part of the PayloadRootAnnotationMethodEndpointMappingTest, and all works fine. You can find it here: https://springframework.svn.sourceforge.net/svnroot/springframework/spring-ws/trunk/core-tiger/src/test/java/org/springframework/ws/server/endpoint/mapping/ https://springframework.svn.sourceforge.net/svnroot/springframework/spring-ws/trunk/core-tiger/src/test/resources/org/springframework/ws/server/endpoint/mapping/ Could you please check out the source of Spring-WS (see http://static.springframework.org/spring-ws/sites/1.5/source-repository.html ), and look at the tests of the core-tiger module, to see what I'm missing?
        Hide
        anthavio Martin Vanek added a comment -

        I've dig out little bit lame test case (XyzEndpoint is main class)

        Show
        anthavio Martin Vanek added a comment - I've dig out little bit lame test case (XyzEndpoint is main class)
        anthavio Martin Vanek made changes -
        Attachment spring-ws-mapping.zip [ 14393 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Fixed.

        This was related to CGLIB subclasses being created by Spring AOP, which do not have the @Endpoint or @PayloadRoot annotations. The current implementation is consistent with Spring MVC's @Controller and @RequestMapping logic, which seems to solve this bug.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Fixed. This was related to CGLIB subclasses being created by Spring AOP, which do not have the @Endpoint or @PayloadRoot annotations. The current implementation is consistent with Spring MVC's @Controller and @RequestMapping logic, which seems to solve this bug.
        arjen.poutsma Arjen Poutsma made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing old issues

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing old issues
        arjen.poutsma Arjen Poutsma made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        3d 19h 23m 1 Arjen Poutsma 14/Jul/08 9:12 PM
        In Progress In Progress Resolved Resolved
        3d 1h 37m 1 Arjen Poutsma 17/Jul/08 10:49 PM
        Resolved Resolved Closed Closed
        1386d 8h 14m 1 Arjen Poutsma 04/May/12 7:03 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            anthavio Martin Vanek
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: