Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5687611ECA for ; Mon, 7 Jul 2014 15:44:34 +0000 (UTC) Received: (qmail 85100 invoked by uid 500); 7 Jul 2014 15:44:33 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 85062 invoked by uid 500); 7 Jul 2014 15:44:33 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 85051 invoked by uid 99); 7 Jul 2014 15:44:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jul 2014 15:44:33 +0000 Date: Mon, 7 Jul 2014 15:44:33 +0000 (UTC) From: "julien Bordeneuve (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CXF-5858) WebClient using GET with complex query param object : IllegalArgumentException: Unresolved variables; only 0 value(s) given for 1 unique variable(s) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] julien Bordeneuve updated CXF-5858: ----------------------------------- Description: Hi, I use the CXF WebClient to GET a message to a server with a complex query , this code work on CXF 2.5.x but after a complete version upgrade to CXF 3.0.0 (also try on 2.7.11). I obtain this exception IllegalArgumentException: Unresolved variables; only 0 value(s) given for 1 unique variable(s). The problem seems to be on the URITemplate when CurlyBraceTokenizer parse the query. for example for my query : criteria={destination:"Paris", arrivalDate:"20/11/2014", nbNight:"2", nbAdult:"1", nbChild:"0", nbRoom:"null"}, The CurlyBraceTokenizer parser split it like this : variable = destination value = "Paris", arrivalDate:"20/11/2014", nbNight:"2", nbAdult:"1", nbChild:"0", nbRoom:"null" client side : " final List providers = new ArrayList(); providers.add(new JacksonJaxbJsonProvider()); // providers.add(new ParamConverterProviderImpl()); WebClient client = WebClient.create( "http://localhost:8090/rest-cxf_v2.7.11/API/REST/POC/", providers); client = client.accept("application/json").type("application/json") .path("/bookingServices/getHotelByCriteria"); client.resetQuery(); final Criteria criteria = new Criteria(); criteria.setDestination("Paris"); criteria.setArrivalDate("20/11/2014"); criteria.setNbNight("2"); criteria.setNbAdult("1"); criteria.setNbChild("2"); criteria.setNbRoom("1"); client.query("criteria", criteria); client.getCurrentURI(); @SuppressWarnings("unchecked") final List hotels = (List) client .getCollection(Hotel.class); assertThat(hotels).isNotNull(); } " server side : @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("/getHotelByCriteria") public List getHotelByCriteria (@QueryParam("criteria") final Criteria criteria) { } was: Hi, I use the CXF WebClient to GET a message to a server with a complex query , this code work on CXF 2.5.x but after a complete version upgrade to CXF 3.0.0 (also try on 2.7.11). I obtain this exception IllegalArgumentException: Unresolved variables; only 0 value(s) given for 1 unique variable(s). It seems have a problem when the URITemplate is contruct, the number is not the well. client side : " final List providers = new ArrayList(); providers.add(new JacksonJaxbJsonProvider()); // providers.add(new ParamConverterProviderImpl()); WebClient client = WebClient.create( "http://localhost:8090/rest-cxf_v2.7.11/API/REST/POC/", providers); client = client.accept("application/json").type("application/json") .path("/bookingServices/getHotelByCriteria"); client.resetQuery(); final Criteria criteria = new Criteria(); criteria.setDestination("Paris"); criteria.setArrivalDate("20/11/2014"); criteria.setNbNight("2"); criteria.setNbAdult("1"); criteria.setNbChild("2"); criteria.setNbRoom("1"); client.query("criteria", criteria); client.getCurrentURI(); @SuppressWarnings("unchecked") final List hotels = (List) client .getCollection(Hotel.class); assertThat(hotels).isNotNull(); } " server side : @GET @Consumes({ MediaType.APPLICATION_JSON }) @Produces({ MediaType.APPLICATION_JSON }) @Path("/getHotelByCriteria") public List getHotelByCriteria (@QueryParam("criteria") final Criteria criteria) { } > WebClient using GET with complex query param object : IllegalArgumentException: Unresolved variables; only 0 value(s) given for 1 unique variable(s) > ---------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: CXF-5858 > URL: https://issues.apache.org/jira/browse/CXF-5858 > Project: CXF > Issue Type: Bug > Affects Versions: 2.7.11, 3.0.0 > Reporter: julien Bordeneuve > > Hi, > I use the CXF WebClient to GET a message to a server with a complex query , this code work on CXF 2.5.x but after a complete version upgrade to CXF 3.0.0 (also try on 2.7.11). I obtain this exception IllegalArgumentException: Unresolved variables; only 0 value(s) given for 1 unique variable(s). > The problem seems to be on the URITemplate when CurlyBraceTokenizer parse the query. > for example for my query : > criteria={destination:"Paris", arrivalDate:"20/11/2014", nbNight:"2", nbAdult:"1", nbChild:"0", nbRoom:"null"}, > The CurlyBraceTokenizer parser split it like this : > variable = destination > value = "Paris", arrivalDate:"20/11/2014", nbNight:"2", nbAdult:"1", nbChild:"0", nbRoom:"null" > client side : > " > final List providers = new ArrayList(); > providers.add(new JacksonJaxbJsonProvider()); > // providers.add(new ParamConverterProviderImpl()); > WebClient client = WebClient.create( > "http://localhost:8090/rest-cxf_v2.7.11/API/REST/POC/", providers); > client = client.accept("application/json").type("application/json") > .path("/bookingServices/getHotelByCriteria"); > client.resetQuery(); > > final Criteria criteria = new Criteria(); > criteria.setDestination("Paris"); > criteria.setArrivalDate("20/11/2014"); > criteria.setNbNight("2"); > criteria.setNbAdult("1"); > criteria.setNbChild("2"); > criteria.setNbRoom("1"); > client.query("criteria", criteria); > > client.getCurrentURI(); > > @SuppressWarnings("unchecked") > final List hotels = (List) client > .getCollection(Hotel.class); > assertThat(hotels).isNotNull(); > } > " > server side : > @GET > @Consumes({ MediaType.APPLICATION_JSON }) > @Produces({ MediaType.APPLICATION_JSON }) > @Path("/getHotelByCriteria") > public List getHotelByCriteria (@QueryParam("criteria") final Criteria criteria) > { > } -- This message was sent by Atlassian JIRA (v6.2#6252)