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 B8E5810CA3 for ; Sun, 6 Apr 2014 10:26:21 +0000 (UTC) Received: (qmail 43634 invoked by uid 500); 6 Apr 2014 10:26:21 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 43507 invoked by uid 500); 6 Apr 2014 10:26:17 -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 43166 invoked by uid 99); 6 Apr 2014 10:26:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Apr 2014 10:26:15 +0000 Date: Sun, 6 Apr 2014 10:26:15 +0000 (UTC) From: "David J. M. Karlsen (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CXF-5675) java.lang.ClassCastException: java.net.URI cannot be cast to java.lang.String when adding Location to Response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 David J. M. Karlsen created CXF-5675: ---------------------------------------- Summary: java.lang.ClassCastException: java.net.URI cannot be cast to java.lang.String when adding Location to Response Key: CXF-5675 URL: https://issues.apache.org/jira/browse/CXF-5675 Project: CXF Issue Type: Bug Components: JAX-RS Affects Versions: 3.0.0-milestone2 Reporter: David J. M. Karlsen Exception: java.lang.ClassCastException: java.net.URI cannot be cast to java.lang.String Test: {code} Response response = getWebClient() .path("/blob") .type(MediaType.MULTIPART_FORM_DATA) .post(multipartBody); {code} serverside resource: {code} URI blobId = UriBuilder.fromResource(getClass()).build(gridFSDBFile.getId()); return Response.created(blobId).build(); {code} because inside WebClient handleResponse -> AbstractClient the values are assumed to be string arrays, but is an URI object: {code} boolean splitHeaders = MessageUtils.isTrue(outMessage.getContextualProperty(HEADER_SPLIT_PROPERTY)); for (Map.Entry> entry : protocolHeaders.entrySet()) { if (null == entry.getKey()) { continue; } if (entry.getValue().size() > 0) { if (HttpUtils.isDateRelatedHeader(entry.getKey())) { currentResponseBuilder.header(entry.getKey(), entry.getValue().get(0)); continue; } for (String val : entry.getValue()) { if (splitHeaders) { String[] values; if (val == null || val.length() == 0) { {code} -- This message was sent by Atlassian JIRA (v6.2#6252)