You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2016/05/23 09:25:12 UTC

[jira] [Comment Edited] (CXF-6902) Problem with resource that returns Object with CXF version == 3.1.2

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

Sergey Beryozkin edited comment on CXF-6902 at 5/23/16 9:25 AM:
----------------------------------------------------------------

The backward compatibility was not broken, instead a spec compliance issue/bug was fixed which is what I said in my previous comment, a TCK test exists which enforces that by default numbers are only supported if it is text/plain. Please also check a JAX-RS 2.0 spec (section on the default providers).

If you think about it, the fact CXF 2.7 was 'supporting' numbers when application/json was expected by writing them as invalid JSON sequences (by simply converting them to String) was a genuine bug. Clearly you'd not want that repeated if you'd like a real application/json sequence be reported. However if you'd like you can register a custom MBW/MBR or may be Jackson which will convert these integers. But given the way it worked before for you, where integers were reported as non-JSON sequences, may be a simpler/better way is to update Produces to text/plain 

Thanks for debugging though - it will help you in case you may want to check some other details in the future. Also as I said earlier - please do direct such queries to the users list. 

Cheers, Sergey  


was (Author: sergey_beryozkin):
It did not brake the backward compatibility, it fixed a spec compliance issue which is what I said in my previous comment, a TCK test exists which enforces that by default numbers are only supported if it is text/plain. Please also check a JAX-RS 2.0 spec (section on the default providers).

If you think about it, the fact CXF 2.7 was 'supporting' numbers when application/json was expected by writing them as invalid JSON sequences (by simply converting them to String) was a genuine bug. Clearly you'd not want that repeated if you'd like a real application/json sequence be reported. However if you'd like you can register a custom MBW/MBR or may be Jackson which will convert these integers. But given the way it worked before for you, where integers were reported as non-JSON sequences, may be a simpler/better way to update Produces to text/plain 

Thanks for debugging though - it will help you in case you may want to check some other details in the future. Also as I said earlier - please do direct such queries to the users list. 

Cheers, Sergey  

> Problem with resource that returns Object with CXF version == 3.1.2
> -------------------------------------------------------------------
>
>                 Key: CXF-6902
>                 URL: https://issues.apache.org/jira/browse/CXF-6902
>             Project: CXF
>          Issue Type: Bug
>          Components: JAXB Databinding
>    Affects Versions: 3.1.2
>            Reporter: Balarami Reddy
>            Assignee: Sergey Beryozkin
>
> Hello,
> We have recently migrated from 2.7 to 3.1.2 and we see a behaviour change in CXF which blocked us from making progress.
> The sample code below gives "No message body writer has been found for response class Integer" which used to work perfect in CXF 2.7
> This is just sample code only. We have in our product several rest calls which return integer/long/Object etc based on some calculations.
> 	@GET
> 	@Produces(MediaType.APPLICATION_JSON)
> 	@Path("/getinteger")
> 	public Response getInteger() {
> 		return Response.ok(4).build();
> 	}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)