You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/06/12 12:18:20 UTC
[jira] [Resolved] (CXF-5073) endless recursion in creating JAX-RS
client proxy
[ https://issues.apache.org/jira/browse/CXF-5073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-5073.
-----------------------------------
Resolution: Fixed
Fix Version/s: 3.0.0
2.7.6
2.6.9
2.5.11
Assignee: Sergey Beryozkin
> endless recursion in creating JAX-RS client proxy
> -------------------------------------------------
>
> Key: CXF-5073
> URL: https://issues.apache.org/jira/browse/CXF-5073
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.7.5
> Reporter: Andras Istvan Nagy
> Assignee: Sergey Beryozkin
> Fix For: 2.5.11, 2.6.9, 2.7.6, 3.0.0
>
> Attachments: drProduct.zip
>
>
> I'm having a problem creating a JAX-RS client proxy with CXF version 2.7.5.
> I wrote a simple sample application designed with a resource model that is built up of "ProductResource"s which contain "parts" which are also "ProductResource"s ("PartsResource" being a collection wrapper resource).
> Creating the client proxy for these resources gets into an endless recursion and eventually fails with a stack overflow. I assume this is related to the loop among the resources (ProductResource -> PartsResource -> ProductResource).
> When this loop is "immediate", i.e. ProductResource directly references its part ProductResource's without the separate "PartsResource" collection wrapper, the client proxy creation does not get into the endless recursion and succeeds.
> On the server side, there are no problems with either resource model.
> @XmlRootElement(name = "ProductResource")
> @Produces("application/json")
> public interface IProductResource {
> @Path("/parts")
> public IPartsResource getParts();
> ...
> }
> @XmlRootElement(name = "PartsResource")
> @Produces("application/json")
> public interface IPartsResource {
> @Path("/{i}/")
> public IProductResource elementAt(@PathParam("i") String i);
> ...
> }
> And the line that gets into the endless recursion (again simplified a bit):
> IProductResource productResource = JAXRSClientFactory.create("http://localhost:9000", IProductResource.class);
> The relevant part of the stack trace, showing the endless recursion:
> ...
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.evaluateResourceClass(ResourceUtils.java:263)
> at org.apache.cxf.jaxrs.utils.ResourceUtils.createClassResourceInfo(ResourceUtils.java:242)
> ...
> Best regards,
> Andras
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira