Description
Test case:
RootResource.java :
public class RootResource
{ @Path("subresource") public abstract SubResource getSubResource(); }In spring-beans.xml:
<bean class="RootResource">
<lookup-method name="getSubResource" bean="subResource" />
</bean>
<bean id="subResource" class="SubResource" />
Then the AOP proxied SubResource:
@RolesAllowed(
{"ROLE_USER"}) // activate Spring Security global method annotations
public class SubResource {
}
Getting the /subresource will throw exception:
org.apache.cxf.interceptor.Fault: object is not an instance of declaring class while invoking
Tried this workaround but not working: Make SubResource implement an interface then on RootResource.getSubResource() use interface as the return type, not the class