users@jersey.java.net

[Jersey] Re: Looking for insight into Jersey 2.0 matching decisions

From: William Ferguson <william.ferguson_at_xandar.com.au>
Date: Tue, 16 Jul 2013 16:23:44 +1000

Thank you, thank you!
Setting header "Content-Type" == "application/json" worked. I had assumed
that POSTman was adding that when configured with raw json.

And thanks for the heads up about request preview in POSTman, I'd missed
that.


On Tue, Jul 16, 2013 at 11:01 AM, Paul Moore <paul.k.moore_at_lineone.net>wrote:

> Check out the "Preview" in POSTman. I think you'll need to set the
> "Content-Type" header. Have not really used POSTman though so no idea if
> it's doing other stuff under the covers - I suspect not though...
>
>
> On 16 July 2013 01:47, William Ferguson <william.ferguson_at_xandar.com.au>wrote:
>
>> I believe so. I was using POSTman (http://www.getpostman.com/) to test
>> via my browsers and configured the Request to be Json. Don't have ability
>> to check at the moment.
>>
>>
>> On Tue, Jul 16, 2013 at 9:57 AM, Paul Moore <paulkmoore_at_gmail.com> wrote:
>>
>>> Hi William,
>>>
>>> Obvious things first...
>>>
>>> Did you set the ContentType header of the HTTP request from the client?
>>>
>>> Best
>>>
>>> Paul
>>>
>>>
>>> On 16 July 2013 00:52, William Ferguson <william.ferguson_at_xandar.com.au>wrote:
>>>
>>>> I'm struggling to determine why Jersey is not matching a JSon POST
>>>> Request against a Resource configured to consume
>>>> MediaType.APPLICATION_JSON
>>>>
>>>> I have configured my Application with JacksonFeature.class and
>>>> packages for my Resources. And the GET Resources are happily being served.
>>>> But any Requests that consume JSon POJO are not being matched.
>>>>
>>>> @POST
>>>> @Path("/create")
>>>> @Consumes(MediaType.APPLICATION_JSON)
>>>> @Produces(MediaType.APPLICATION_JSON)
>>>> public Meet createMeetJson(Meet meet)
>>>>
>>>> What component is responsible for making the matching decision?
>>>> Is there some way to switch on debug level logging so I can determine
>>>> why the match is not being made?
>>>>
>>>> Jersey looked so promising originally but I'm finding the lack of
>>>> visibility very frustrating.
>>>>
>>>> William
>>>>
>>>>
>>>
>>
>