Hi All,

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 "Product"s which contain "parts" which are also "Product"s
("Parts" 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 (Product -> Parts -> Product).
When this loop is "immediate", i.e. Product directly references its part
Products without the separate "Parts" 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.

If this is not a known limitation, I would go ahead and file it in the
issue tracker with the actual code sample, I'd just like someone to confirm
that.

Of course it's also possible that I'm just doing something wrong. Here are
the relevant resource interfaces (simplified):

@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);

Thank you for your help,
best regards,
Andras

Reply via email to