cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5675) java.lang.ClassCastException: java.net.URI cannot be cast to java.lang.String when adding Location to Response
Date Mon, 07 Apr 2014 23:42:15 GMT

    [ https://issues.apache.org/jira/browse/CXF-5675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13962393#comment-13962393
] 

Sergey Beryozkin commented on CXF-5675:
---------------------------------------

Can you paste a stacktrace please ? I have a test checking Location.

Thanks

> 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<String, List<String>> 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)

Mime
View raw message