[
https://issues.apache.org/jira/browse/CXF-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12732613#action_12732613
]
Sergey Beryozkin commented on CXF-2345:
---------------------------------------
Actually, I meant 2.3-SNAPSHOT as 2.2.3-SNAPSHOT is not being built regularly.
You might also want to inject a SubResource from Spring, as a root resource
property, rather than using <lookupMethod/>. I have atest for it too, but the
injected resource implements the JAX-RS annotated interface, haven't tried
injecting a CGLIB proxy - but given that I can see a test working now with
<lookupMethod/> I'm pretty sure it will work too
> Returning AOP/CGLIB proxy as Subresource throws Fault "object is not an
> instance of declaring class"
> ----------------------------------------------------------------------------------------------------
>
> Key: CXF-2345
> URL: https://issues.apache.org/jira/browse/CXF-2345
> Project: CXF
> Issue Type: Bug
> Components: REST
> Affects Versions: 2.2.2
> Reporter: Hendy Irawan
> Assignee: Sergey Beryozkin
> Fix For: 2.2.3, 2.3
>
>
> 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
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.