You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by nino martinez wael <ni...@gmail.com> on 2017/11/30 13:22:06 UTC

CXF 3.21 and bean validation

Hi

Is it possible to use both

org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper

And

org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/org.apache.cxf.jaxrs.validation.ValidationExceptionMapper

together.. Currently is seems the ValidationExceptionMapper are
catching my NotAcceptableException etc and coughing up 500's


-- 

Best regards / Med venlig hilsen
Nino Martinez

Re: CXF 3.21 and bean validation

Posted by Sergey Beryozkin <sb...@gmail.com>.
Continuing on this, dealing with the user issues, however trivial or 
complex they might be, definitely does not qualify as a 'loss of time'. 
However, having something more specific to look at, the test case, or 
some 'evidence' like the log, etc, can help decide if it is a problem 
and then resolve the problem faster :-)

Sergey
On 01/12/17 10:03, Sergey Beryozkin wrote:
> Np at all, sorry for actually being impatient as I actually did not lose 
> any time :-). You know, sometimes, one can get a bit more protective 
> than needed of the code :-) which is as it happens not ideal and may 
> indeed have bugs hidden somewhere...
> 
> Sergey
> 
> On 01/12/17 06:13, nino martinez wael wrote:
>> Somehow I cannot replicate the issue today !!! Not on my developer 
>> machine
>> or our test server! Typical when you fired up your debugger!
>>
>> I am terrible sorry for the loss of your time Sergey :(
>>
>> -Nino
>>
>> On Fri, Dec 1, 2017 at 6:43 AM, nino martinez wael <
>> nino.martinez.wael@gmail.com> wrote:
>>
>>> Well its not a custom exception, unless you consider jax rs 2, my 
>>> creation
>>> :)
>>>
>>> javax.ws.rs.NotAcceptableException
>>>
>>> I will digg into it, thanks for your patience.
>>>
>>> On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sb...@gmail.com>
>>> wrote:
>>>
>>>> Can you please debug ?
>>>>
>>>> Sergey
>>>>
>>>> On 30/11/17 14:08, Sergey Beryozkin wrote:
>>>>
>>>>> I'm sorry but I don't have time for dealing with some indirect
>>>>> assumptions that ValidationExceptionMapper which is typed with
>>>>> toResponse(ValidationException) somehow accepts your custom
>>>>> NotAcceptableException.
>>>>>
>>>>> Unless it is an instance of ValidationException ?
>>>>> On 30/11/17 14:02, nino martinez wael wrote:
>>>>>
>>>>>> When my app throws:
>>>>>>
>>>>>> throw new NotAcceptableException("Client tried with wrong format <" +
>>>>>> orgImportRecord.toString() + ">");
>>>>>>
>>>>>>
>>>>>> the client gets an 500.. looking in the log I can see that the
>>>>>> ValidationExceptionMapper is "responsible"..
>>>>>>
>>>>>>
>>>>>> I can come with an more complete example. if you want?
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin 
>>>>>> <sberyozkin@gmail.com
>>>>>>>
>>>>>> wrote:
>>>>>>
>>>>>> How did you come to this conclusion ?
>>>>>>>
>>>>>>> Sergey
>>>>>>> On 30/11/17 13:22, nino martinez wael wrote:
>>>>>>>
>>>>>>> Hi
>>>>>>>>
>>>>>>>> Is it possible to use both
>>>>>>>>
>>>>>>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>>>>>>
>>>>>>>> And
>>>>>>>>
>>>>>>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>>>>>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>>>>>>
>>>>>>>> together.. Currently is seems the ValidationExceptionMapper are
>>>>>>>> catching my NotAcceptableException etc and coughing up 500's
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> -- 
>>>>>>> Sergey Beryozkin
>>>>>>>
>>>>>>> Talend Community Coders
>>>>>>> http://coders.talend.com/
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Sergey Beryozkin
>>>>
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>>>
>>>
>>>
>>>
>>> -- 
>>> Best regards / Med venlig hilsen
>>> Nino Martinez
>>>
>>
>>
>>

Re: CXF 3.21 and bean validation

Posted by Sergey Beryozkin <sb...@gmail.com>.
Np at all, sorry for actually being impatient as I actually did not lose 
any time :-). You know, sometimes, one can get a bit more protective 
than needed of the code :-) which is as it happens not ideal and may 
indeed have bugs hidden somewhere...

Sergey

On 01/12/17 06:13, nino martinez wael wrote:
> Somehow I cannot replicate the issue today !!! Not on my developer machine
> or our test server! Typical when you fired up your debugger!
> 
> I am terrible sorry for the loss of your time Sergey :(
> 
> -Nino
> 
> On Fri, Dec 1, 2017 at 6:43 AM, nino martinez wael <
> nino.martinez.wael@gmail.com> wrote:
> 
>> Well its not a custom exception, unless you consider jax rs 2, my creation
>> :)
>>
>> javax.ws.rs.NotAcceptableException
>>
>> I will digg into it, thanks for your patience.
>>
>> On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sb...@gmail.com>
>> wrote:
>>
>>> Can you please debug ?
>>>
>>> Sergey
>>>
>>> On 30/11/17 14:08, Sergey Beryozkin wrote:
>>>
>>>> I'm sorry but I don't have time for dealing with some indirect
>>>> assumptions that ValidationExceptionMapper which is typed with
>>>> toResponse(ValidationException) somehow accepts your custom
>>>> NotAcceptableException.
>>>>
>>>> Unless it is an instance of ValidationException ?
>>>> On 30/11/17 14:02, nino martinez wael wrote:
>>>>
>>>>> When my app throws:
>>>>>
>>>>> throw new NotAcceptableException("Client tried with wrong format <" +
>>>>> orgImportRecord.toString() + ">");
>>>>>
>>>>>
>>>>> the client gets an 500.. looking in the log I can see that the
>>>>> ValidationExceptionMapper is "responsible"..
>>>>>
>>>>>
>>>>> I can come with an more complete example. if you want?
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sberyozkin@gmail.com
>>>>>>
>>>>> wrote:
>>>>>
>>>>> How did you come to this conclusion ?
>>>>>>
>>>>>> Sergey
>>>>>> On 30/11/17 13:22, nino martinez wael wrote:
>>>>>>
>>>>>> Hi
>>>>>>>
>>>>>>> Is it possible to use both
>>>>>>>
>>>>>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>>>>>
>>>>>>> And
>>>>>>>
>>>>>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>>>>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>>>>>
>>>>>>> together.. Currently is seems the ValidationExceptionMapper are
>>>>>>> catching my NotAcceptableException etc and coughing up 500's
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Sergey Beryozkin
>>>>>>
>>>>>> Talend Community Coders
>>>>>> http://coders.talend.com/
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> --
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>
>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
> 
> 
> 

Re: CXF 3.21 and bean validation

Posted by nino martinez wael <ni...@gmail.com>.
Somehow I cannot replicate the issue today !!! Not on my developer machine
or our test server! Typical when you fired up your debugger!

I am terrible sorry for the loss of your time Sergey :(

-Nino

On Fri, Dec 1, 2017 at 6:43 AM, nino martinez wael <
nino.martinez.wael@gmail.com> wrote:

> Well its not a custom exception, unless you consider jax rs 2, my creation
> :)
>
> javax.ws.rs.NotAcceptableException
>
> I will digg into it, thanks for your patience.
>
> On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
>
>> Can you please debug ?
>>
>> Sergey
>>
>> On 30/11/17 14:08, Sergey Beryozkin wrote:
>>
>>> I'm sorry but I don't have time for dealing with some indirect
>>> assumptions that ValidationExceptionMapper which is typed with
>>> toResponse(ValidationException) somehow accepts your custom
>>> NotAcceptableException.
>>>
>>> Unless it is an instance of ValidationException ?
>>> On 30/11/17 14:02, nino martinez wael wrote:
>>>
>>>> When my app throws:
>>>>
>>>> throw new NotAcceptableException("Client tried with wrong format <" +
>>>> orgImportRecord.toString() + ">");
>>>>
>>>>
>>>> the client gets an 500.. looking in the log I can see that the
>>>> ValidationExceptionMapper is "responsible"..
>>>>
>>>>
>>>> I can come with an more complete example. if you want?
>>>>
>>>>
>>>>
>>>> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sberyozkin@gmail.com
>>>> >
>>>> wrote:
>>>>
>>>> How did you come to this conclusion ?
>>>>>
>>>>> Sergey
>>>>> On 30/11/17 13:22, nino martinez wael wrote:
>>>>>
>>>>> Hi
>>>>>>
>>>>>> Is it possible to use both
>>>>>>
>>>>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>>>>
>>>>>> And
>>>>>>
>>>>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>>>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>>>>
>>>>>> together.. Currently is seems the ValidationExceptionMapper are
>>>>>> catching my NotAcceptableException etc and coughing up 500's
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> Sergey Beryozkin
>>>>>
>>>>> Talend Community Coders
>>>>> http://coders.talend.com/
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>



-- 
Best regards / Med venlig hilsen
Nino Martinez

Re: CXF 3.21 and bean validation

Posted by nino martinez wael <ni...@gmail.com>.
Well its not a custom exception, unless you consider jax rs 2, my creation
:)

javax.ws.rs.NotAcceptableException

I will digg into it, thanks for your patience.

On Thu, Nov 30, 2017 at 3:31 PM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> Can you please debug ?
>
> Sergey
>
> On 30/11/17 14:08, Sergey Beryozkin wrote:
>
>> I'm sorry but I don't have time for dealing with some indirect
>> assumptions that ValidationExceptionMapper which is typed with
>> toResponse(ValidationException) somehow accepts your custom
>> NotAcceptableException.
>>
>> Unless it is an instance of ValidationException ?
>> On 30/11/17 14:02, nino martinez wael wrote:
>>
>>> When my app throws:
>>>
>>> throw new NotAcceptableException("Client tried with wrong format <" +
>>> orgImportRecord.toString() + ">");
>>>
>>>
>>> the client gets an 500.. looking in the log I can see that the
>>> ValidationExceptionMapper is "responsible"..
>>>
>>>
>>> I can come with an more complete example. if you want?
>>>
>>>
>>>
>>> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sb...@gmail.com>
>>> wrote:
>>>
>>> How did you come to this conclusion ?
>>>>
>>>> Sergey
>>>> On 30/11/17 13:22, nino martinez wael wrote:
>>>>
>>>> Hi
>>>>>
>>>>> Is it possible to use both
>>>>>
>>>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>>>
>>>>> And
>>>>>
>>>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>>>
>>>>> together.. Currently is seems the ValidationExceptionMapper are
>>>>> catching my NotAcceptableException etc and coughing up 500's
>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> Sergey Beryozkin
>>>>
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>



-- 
Best regards / Med venlig hilsen
Nino Martinez

Re: CXF 3.21 and bean validation

Posted by Sergey Beryozkin <sb...@gmail.com>.
Can you please debug ?

Sergey
On 30/11/17 14:08, Sergey Beryozkin wrote:
> I'm sorry but I don't have time for dealing with some indirect 
> assumptions that ValidationExceptionMapper which is typed with
> toResponse(ValidationException) somehow accepts your custom
> NotAcceptableException.
> 
> Unless it is an instance of ValidationException ?
> On 30/11/17 14:02, nino martinez wael wrote:
>> When my app throws:
>>
>> throw new NotAcceptableException("Client tried with wrong format <" +
>> orgImportRecord.toString() + ">");
>>
>>
>> the client gets an 500.. looking in the log I can see that the
>> ValidationExceptionMapper is "responsible"..
>>
>>
>> I can come with an more complete example. if you want?
>>
>>
>>
>> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sb...@gmail.com>
>> wrote:
>>
>>> How did you come to this conclusion ?
>>>
>>> Sergey
>>> On 30/11/17 13:22, nino martinez wael wrote:
>>>
>>>> Hi
>>>>
>>>> Is it possible to use both
>>>>
>>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>>
>>>> And
>>>>
>>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>>
>>>> together.. Currently is seems the ValidationExceptionMapper are
>>>> catching my NotAcceptableException etc and coughing up 500's
>>>>
>>>>
>>>>
>>>
>>> -- 
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>
>>
>>
> 
> 


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: CXF 3.21 and bean validation

Posted by Sergey Beryozkin <sb...@gmail.com>.
I'm sorry but I don't have time for dealing with some indirect 
assumptions that ValidationExceptionMapper which is typed with
toResponse(ValidationException) somehow accepts your custom
NotAcceptableException.

Unless it is an instance of ValidationException ?
On 30/11/17 14:02, nino martinez wael wrote:
> When my app throws:
> 
> throw new NotAcceptableException("Client tried with wrong format <" +
> orgImportRecord.toString() + ">");
> 
> 
> the client gets an 500.. looking in the log I can see that the
> ValidationExceptionMapper is "responsible"..
> 
> 
> I can come with an more complete example. if you want?
> 
> 
> 
> On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
> 
>> How did you come to this conclusion ?
>>
>> Sergey
>> On 30/11/17 13:22, nino martinez wael wrote:
>>
>>> Hi
>>>
>>> Is it possible to use both
>>>
>>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>>
>>> And
>>>
>>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>>
>>> together.. Currently is seems the ValidationExceptionMapper are
>>> catching my NotAcceptableException etc and coughing up 500's
>>>
>>>
>>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
> 
> 
> 


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: CXF 3.21 and bean validation

Posted by nino martinez wael <ni...@gmail.com>.
When my app throws:

throw new NotAcceptableException("Client tried with wrong format <" +
orgImportRecord.toString() + ">");


the client gets an 500.. looking in the log I can see that the
ValidationExceptionMapper is "responsible"..


I can come with an more complete example. if you want?



On Thu, Nov 30, 2017 at 2:27 PM, Sergey Beryozkin <sb...@gmail.com>
wrote:

> How did you come to this conclusion ?
>
> Sergey
> On 30/11/17 13:22, nino martinez wael wrote:
>
>> Hi
>>
>> Is it possible to use both
>>
>> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
>>
>> And
>>
>> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/o
>> rg.apache.cxf.jaxrs.validation.ValidationExceptionMapper
>>
>> together.. Currently is seems the ValidationExceptionMapper are
>> catching my NotAcceptableException etc and coughing up 500's
>>
>>
>>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>



-- 
Best regards / Med venlig hilsen
Nino Martinez

Re: CXF 3.21 and bean validation

Posted by Sergey Beryozkin <sb...@gmail.com>.
How did you come to this conclusion ?

Sergey
On 30/11/17 13:22, nino martinez wael wrote:
> Hi
> 
> Is it possible to use both
> 
> org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper
> 
> And
> 
> org.apache.cxf.jaxrs.validation.JAXRSBeanValidationFeature/org.apache.cxf.jaxrs.validation.ValidationExceptionMapper
> 
> together.. Currently is seems the ValidationExceptionMapper are
> catching my NotAcceptableException etc and coughing up 500's
> 
> 


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/