[SWS-396] @Endpoint with method having any other annotation then @PayloadRoot is not mapped Created: 11/Jul/08  Updated: 04/May/12  Resolved: 17/Jul/08

Status: Closed
Project: Spring Web Services
Component/s: Core
Affects Version/s: 1.5.3
Fix Version/s: 1.5.4

Type: Bug Priority: Major
Reporter: Martin Vanek Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

spring 2.5.5, spring-ws 1.5.3, spring-security 2.0.3


Attachments: Zip Archive spring-ws-mapping.zip    

 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.



 Comments   
Comment by Arjen Poutsma [ 13/Jul/08 ]

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

Comment by Martin Vanek [ 14/Jul/08 ]

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.

Comment by Arjen Poutsma [ 14/Jul/08 ]

Ok, thanks for that. This information really helps .

Comment by Arjen Poutsma [ 14/Jul/08 ]

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?

Comment by Martin Vanek [ 16/Jul/08 ]

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

Comment by Arjen Poutsma [ 17/Jul/08 ]

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.

Comment by Arjen Poutsma [ 04/May/12 ]

Closing old issues

Generated at Tue Dec 12 18:07:09 UTC 2017 using JIRA 6.4.14#64029-sha1:ae256fe0fbb912241490ff1cecfb323ea0905ca5.