cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Unresolved variables; only 0 value(s) given for 1 unique variable(s)
Date Mon, 30 Jul 2012 19:53:37 GMT
Hi Matt

On 30/07/12 19:00, Matt Massie wrote:
> Let me start by thanking your team for writing such a good piece of code.
> CXF has worked well for us.
>
> For one project, we used CXF to create a JAX-RS service that uses nested
> subresources. Originally, we only provided a Python client to REST
> interface. I'm in the process of using the CXF JAXRSClientFactory to create
> a Java client for customers as well.  Unfortunately, the way we've
> annotated the code is causing errors in the client code and I'm at a loss
> to understand exactly why.
>
> I've distilled the problem down to a simple test case and posted it as a
> gist.
>
>        https://gist.github.com/3207745

Thanks for making this code available, helped me reproduce the issue
immediately.

>
> Whenever I run the above test case, I get the following exception:
>
> java.lang.IllegalArgumentException: Unresolved variables; only 0 value(s)
> given for 1 unique variable(s)
>   at
> org.apache.cxf.jaxrs.impl.UriBuilderImpl.substituteVarargs(UriBuilderImpl.java:185)
> at org.apache.cxf.jaxrs.impl.UriBuilderImpl.doBuild(UriBuilderImpl.java:82)
>   at
> org.apache.cxf.jaxrs.impl.UriBuilderImpl.buildFromEncoded(UriBuilderImpl.java:218)
> at
> org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:152)
>   at $Proxy15.getGrandchildResource(Unknown Source)
> at com.cloudera.api.v1.impl.TestClass.testCase(TestClass.java:92)
>
> It appears that the client code is unable to generate a request URI from
> the @Path annotation we're providing.
>
> Is there anything obviously wrong with the code in the gist that you can
> see?  Any guidance you can provide would be very appreciated.
>

ChildResource has
@Path("/{childName}/grandChildren")

on one of its methods,
but no @PathParam("childName") is avaialble

I've updated the method and the test passed

Cheers, Sergey

> -Matt
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Mime
View raw message