Re: CXF 3.21 and bean validation

2017-11-30 Thread nino martinez wael
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.w...@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 
> 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 >>> >
 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

2017-11-30 Thread nino martinez wael
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 
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 
>>> 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

2017-11-30 Thread Sergey Beryozkin

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 
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

2017-11-30 Thread Sergey Beryozkin
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 
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

2017-11-30 Thread nino martinez wael
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 
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

2017-11-30 Thread Sergey Beryozkin

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/


CXF 3.21 and bean validation

2017-11-30 Thread nino martinez wael
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.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
No change without setting swagger2customizer..

I'll let it rest for a day..

On Thu, Nov 30, 2017 at 1:30 PM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> yup have set skip.default.json.provider.registration..
>
> But no matter what I do it has no effect on what the swagger feature
> generates.. Where it's changing the json provider or removing it all
> together..
>
> Trying it now without setting swagger2Customizer..
>
>
> On Thu, Nov 30, 2017 at 1:04 PM, Sergey Beryozkin 
> wrote:
>
>> Just FYI, removing Jettison lib will ensure it's not auto-installed by
>> CXF, and if it is not possible to remove then the other option is to set
>> a "skip.default.json.provider.registration" bus property.
>>
>> However it's not related to Swagger at all, Jettison if installed will
>> only affect the way JSON is generated for service responses
>>
>> Sergey
>>
>> On 30/11/17 11:57, nino martinez wael wrote:
>>
>>> It does not seem to be a jettison problem.. And neither an problem with
>>> jackson versions, I just wiped all jettison and jackson(except 2.9.1 )
>>> versions from my running environment..
>>>
>>> Looking into of it could be something with JacksonJaxbJsonProvider vs
>>> JacksonJsonProvider
>>>
>>> On Thu, Nov 30, 2017 at 12:45 PM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> IS there somewhere while on runtime where I can print current registered
 providers for cxf, I have a feeling that it somehow are using jettison
 for
 json...

 On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael <
 nino.martinez.w...@gmail.com> wrote:

 Okay I will check into libraries whats on class path.. I have the same
> gut feeling that it could be something like that.
>
> I have enunciate up and working on the side..
>
> On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin <
> sberyoz...@gmail.com>
> wrote:
>
> Yes, the minor Swagger version caused this change, what was working
>> 3.1.x, specifically the serializers approach, was not working any
>> longer
>> with the new Swagger version, hence this update.
>>
>> I honestly do not know why exactly a JAXB annotated bean is not
>> correctly represented in the Swagger-generated #definitions, it's
>> obviously
>> something to do with the way Jackson and JAXB interacts.
>> Perhaps Jackson you register with DOSGI is not the same version
>> installed by the CXF swagger2 feature, perhaps some diff JAXB
>> versions are
>> involved, please keep experimenting
>>
>> Sergey
>>
>> defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
>>
>>> swagger.setSwagger2Serializers(defaultSwagger2Serializers);
>>>
>>> I think this could be the same:
>>>
>>> Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
>>> swagger2Customizer.setJavadocProvider(new JavaDocProvider());
>>>
>>>
>>> swagger.setCustomizer(swagger2Customizer);
>>>
>>>
>>> I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)
>>>
>>>
>>> How can I tell swagger to do the same? I think that's the problem..
>>>
>>>
>>>
>>> regards Nino
>>>
>>>
>>>
>>>
>>> On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> Im wondering if this could be the problem :
>>>

 https://github.com/swagger-api/swagger-core/issues/960

 On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
 nino.martinez.w...@gmail.com> wrote:

 So I have a bean CXF accepts only this interpretation for my
 endpoint:

>
> {
>   "contactList": [
>   {
>   "campaignId": "2",
>   "id":"",
>   "indexNumber": "",
>   "accountNumber": "232",
>   "queueNumber": "0",
>   "balance": 0,
>   "personalIdentificationNumber1": "string",
>   "firstName1": "string",
>   "lastName1": "string",
>   "personalIdentificationNumber2": "string",
>   "firstName2": "string",
>   "lastName2": "string",
>   "address": "string",
>   "zipCode": "string",
>   "city": "string",
>   "homePhone": "+4521",
>   "mobilePhone": "+45122",
>   "campaing": "string",
>   "dateForExtract": "string"
>
>   }
>   ]
> }
>
> However the swagger feature are generating this as example:
>
> {
> "minimalContacts": [
>   {
> "campaignId": "string",
> "id":

Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
yup have set skip.default.json.provider.registration..

But no matter what I do it has no effect on what the swagger feature
generates.. Where it's changing the json provider or removing it all
together..

Trying it now without setting swagger2Customizer..


On Thu, Nov 30, 2017 at 1:04 PM, Sergey Beryozkin 
wrote:

> Just FYI, removing Jettison lib will ensure it's not auto-installed by
> CXF, and if it is not possible to remove then the other option is to set
> a "skip.default.json.provider.registration" bus property.
>
> However it's not related to Swagger at all, Jettison if installed will
> only affect the way JSON is generated for service responses
>
> Sergey
>
> On 30/11/17 11:57, nino martinez wael wrote:
>
>> It does not seem to be a jettison problem.. And neither an problem with
>> jackson versions, I just wiped all jettison and jackson(except 2.9.1 )
>> versions from my running environment..
>>
>> Looking into of it could be something with JacksonJaxbJsonProvider vs
>> JacksonJsonProvider
>>
>> On Thu, Nov 30, 2017 at 12:45 PM, nino martinez wael <
>> nino.martinez.w...@gmail.com> wrote:
>>
>> IS there somewhere while on runtime where I can print current registered
>>> providers for cxf, I have a feeling that it somehow are using jettison
>>> for
>>> json...
>>>
>>> On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> Okay I will check into libraries whats on class path.. I have the same
 gut feeling that it could be something like that.

 I have enunciate up and working on the side..

 On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin <
 sberyoz...@gmail.com>
 wrote:

 Yes, the minor Swagger version caused this change, what was working
> 3.1.x, specifically the serializers approach, was not working any
> longer
> with the new Swagger version, hence this update.
>
> I honestly do not know why exactly a JAXB annotated bean is not
> correctly represented in the Swagger-generated #definitions, it's
> obviously
> something to do with the way Jackson and JAXB interacts.
> Perhaps Jackson you register with DOSGI is not the same version
> installed by the CXF swagger2 feature, perhaps some diff JAXB versions
> are
> involved, please keep experimenting
>
> Sergey
>
> defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
>
>> swagger.setSwagger2Serializers(defaultSwagger2Serializers);
>>
>> I think this could be the same:
>>
>> Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
>> swagger2Customizer.setJavadocProvider(new JavaDocProvider());
>>
>>
>> swagger.setCustomizer(swagger2Customizer);
>>
>>
>> I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)
>>
>>
>> How can I tell swagger to do the same? I think that's the problem..
>>
>>
>>
>> regards Nino
>>
>>
>>
>>
>> On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
>> nino.martinez.w...@gmail.com> wrote:
>>
>> Im wondering if this could be the problem :
>>
>>>
>>> https://github.com/swagger-api/swagger-core/issues/960
>>>
>>> On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> So I have a bean CXF accepts only this interpretation for my
>>> endpoint:
>>>

 {
   "contactList": [
   {
   "campaignId": "2",
   "id":"",
   "indexNumber": "",
   "accountNumber": "232",
   "queueNumber": "0",
   "balance": 0,
   "personalIdentificationNumber1": "string",
   "firstName1": "string",
   "lastName1": "string",
   "personalIdentificationNumber2": "string",
   "firstName2": "string",
   "lastName2": "string",
   "address": "string",
   "zipCode": "string",
   "city": "string",
   "homePhone": "+4521",
   "mobilePhone": "+45122",
   "campaing": "string",
   "dateForExtract": "string"

   }
   ]
 }

 However the swagger feature are generating this as example:

 {
 "minimalContacts": [
   {
 "campaignId": "string",
 "id": 0,
 "indexNumber": "string",
 "accountNumber": "string",
 "queueNumber": "string",
 "balance": 0,
 "personalIdentificationNumber1": "string",
 "firstName1": "string",
 "lastName1": "string",
 

RE: SSL: SNI support in java 8 and CXF 3.1.7

2017-11-30 Thread Andrei Shakirin
Hi Colm,

Thanks for information, it is exactly what I looking for.
I will try to patch 3.1.7 with your fix.

Regards,
Andrei.

> -Original Message-
> From: Colm O hEigeartaigh [mailto:cohei...@apache.org]
> Sent: Donnerstag, 30. November 2017 11:18
> To: users@cxf.apache.org
> Subject: Re: SSL: SNI support in java 8 and CXF 3.1.7
> 
> Hi Andrei,
> 
> It works in CXF 3.2.1 due to a fix I did which is also in CXF 3.1.10:
> 
> https://issues.apache.org/jira/browse/CXF-7233
> 
> Is it an option for you to upgrade to CXF 3.1.10?
> 
> Colm.
> 
> On Wed, Nov 29, 2017 at 9:57 PM, Andrei Shakirin 
> wrote:
> 
> > Hi Colm,
> >
> > Perhaps you have an idea how to resolve the following issue:
> >
> > I try to setup SSL connection to server https://sandbox.tiramizoo.com/
> > using CXF Rest client (CXF 3.1.7, WebClient or JAX-RS Client).
> >
> > The code running under JDK 1.8.0_131 fails:
> > Caused by: javax.net.ssl.SSLException: Received fatal alert: internal_error
> > at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
> > at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
> >
> > Looking for the reason, I discovered that the reason of the problem is
> > missing SNI during handshake:
> >
> > Log of success case:
> > ...
> > Extension server_name, server_name: [type=host_name (0), value=
> > sandbox.tiramizoo.com]
> >
> > [write] MD5 and SHA1 hashes:  len = 191
> > : 01 00 00 BB 03 03 5A 1E   8C 8D EB 9D 2A D8 DC E2  ..Z.*...
> > 0010: D5 63 9B 7C 07 10 D9 25   A3 51 F3 C1 2B 1F B0 1A  .c.%.Q..+...
> > 0020: 3F 57 CA BA 1E E7 00 00   3A C0 23 C0 27 00 3C C0  ?W..:.#.'.<.
> > 0030: 25 C0 29 00 67 00 40 C0   09 C0 13 00 2F C0 04 C0  %.).g.@./...
> > 0040: 0E 00 33 00 32 C0 2B C0   2F 00 9C C0 2D C0 31 00  ..3.2.+./...-.1.
> > 0050: 9E 00 A2 C0 08 C0 12 00   0A C0 03 C0 0D 00 16 00  
> > 0060: 13 00 FF 01 00 00 58 00   0A 00 16 00 14 00 17 00  ..X.
> > 0070: 18 00 19 00 09 00 0A 00   0B 00 0C 00 0D 00 0E 00  
> > 0080: 16 00 0B 00 02 01 00 00   0D 00 16 00 14 06 03 06  
> > 0090: 01 05 03 05 01 04 03 04   01 04 02 02 03 02 01 02  
> > 00A0: 02 00 00 00 1A 00 18 00   00 15 73 61 6E 64 62 6F  ..sandbo
> > 00B0: 78 2E 74 69 72 61 6D 69   7A 6F 6F 2E 63 6F 6D x.tiramizoo.com
> >
> > Log of problem case:
> > ...
> > [NO Extension server_name]
> > [write] MD5 and SHA1 hashes:  len = 203
> > : 01 00 00 C7 03 03 5A 1E   8B 3F 08 56 DB C9 02 81  ..Z..?.V
> > 0010: F7 6C F9 32 0F EC C3 1A   9A 7D 1C 04 C3 1B C7 D5  .l.2
> > 0020: 6E 12 73 55 4C A3 00 00   64 C0 24 C0 28 00 3D C0  n.sUL...d.$.(.=.
> > 0030: 26 C0 2A 00 6B 00 6A C0   0A C0 14 00 35 C0 05 C0  &.*.k.j.5...
> > 0040: 0F 00 39 00 38 C0 23 C0   27 00 3C C0 25 C0 29 00  ..9.8.#.'.<.%.).
> > 0050: 67 00 40 C0 09 C0 13 00   2F C0 04 C0 0E 00 33 00  g.@./.3.
> > 0060: 32 C0 2C C0 2B C0 30 00   9D C0 2E C0 32 00 9F 00  2.,.+.0.2...
> > 0070: A3 C0 2F 00 9C C0 2D C0   31 00 9E 00 A2 C0 08 C0  ../...-.1...
> > 0080: 12 00 0A C0 03 C0 0D 00   16 00 13 00 FF 01 00 00  
> > 0090: 3A 00 0A 00 16 00 14 00   17 00 18 00 19 00 09 00  :...
> > 00A0: 0A 00 0B 00 0C 00 0D 00   0E 00 16 00 0B 00 02 01  
> > 00B0: 00 00 0D 00 16 00 14 06   03 06 01 05 03 05 01 04  
> > 00C0: 03 04 01 04 02 02 03 02   01 02 02 ...
> >
> >
> > The problem is likely caused by bug in JDK
> > https://bugs.openjdk.java.net/
> > browse/JDK-8072464 that prevents sending SNI if client registers
> > custom HostnameVerifier.
> > I can also reproduce it with simple Java HttpsURLConnection +
> > registring HostnameVerifier.
> >
> > Interesting that result of SSL connection to
> > https://sandbox.tiramizoo.com/ looks like:
> > 1) failed with CXF 3.1.7 and JDK 1.8.0_131
> > 2) failed with simple HttpsURLConnection + registring HostnameVerifier
> > and JDK 1.8.0_1311)
> > 3) successful with CXF 3.2.1 and JDK 1.8.0_131
> > 4) successful with CXF 3.2.1 and JDK 1.8.0_151
> > 5) successful with simple HttpsURLConnection + registring
> > HostnameVerifier and JDK 1.8.0_151
> >
> > Questions:
> > - any idea why this connection works with CXF 3.2.1 and JDK 1.8.0_131,
> > despite of fact that CXF 3.2.1 registers the custom HostnameVerifier
> > as well?
> > - are there any workaround for CXF 3.1.7 and JDK 1.8.0_131?
> >
> > Small example to reproduce the issue is attached.
> >
> > Regards,
> > Andrei.
> >
> >
> 
> 
> --
> Colm O hEigeartaigh
> 
> Talend Community Coder
> http://coders.talend.com


Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
It does not seem to be a jettison problem.. And neither an problem with
jackson versions, I just wiped all jettison and jackson(except 2.9.1 )
versions from my running environment..

Looking into of it could be something with JacksonJaxbJsonProvider vs
JacksonJsonProvider

On Thu, Nov 30, 2017 at 12:45 PM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> IS there somewhere while on runtime where I can print current registered
> providers for cxf, I have a feeling that it somehow are using jettison for
> json...
>
> On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael <
> nino.martinez.w...@gmail.com> wrote:
>
>> Okay I will check into libraries whats on class path.. I have the same
>> gut feeling that it could be something like that.
>>
>> I have enunciate up and working on the side..
>>
>> On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin 
>> wrote:
>>
>>> Yes, the minor Swagger version caused this change, what was working
>>> 3.1.x, specifically the serializers approach, was not working any longer
>>> with the new Swagger version, hence this update.
>>>
>>> I honestly do not know why exactly a JAXB annotated bean is not
>>> correctly represented in the Swagger-generated #definitions, it's obviously
>>> something to do with the way Jackson and JAXB interacts.
>>> Perhaps Jackson you register with DOSGI is not the same version
>>> installed by the CXF swagger2 feature, perhaps some diff JAXB versions are
>>> involved, please keep experimenting
>>>
>>> Sergey
>>>
>>> defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
 swagger.setSwagger2Serializers(defaultSwagger2Serializers);

 I think this could be the same:

 Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
 swagger2Customizer.setJavadocProvider(new JavaDocProvider());


 swagger.setCustomizer(swagger2Customizer);


 I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)


 How can I tell swagger to do the same? I think that's the problem..



 regards Nino




 On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
 nino.martinez.w...@gmail.com> wrote:

 Im wondering if this could be the problem :
>
> https://github.com/swagger-api/swagger-core/issues/960
>
> On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
> nino.martinez.w...@gmail.com> wrote:
>
> So I have a bean CXF accepts only this interpretation for my endpoint:
>>
>> {
>>  "contactList": [
>>  {
>>  "campaignId": "2",
>>  "id":"",
>>  "indexNumber": "",
>>  "accountNumber": "232",
>>  "queueNumber": "0",
>>  "balance": 0,
>>  "personalIdentificationNumber1": "string",
>>  "firstName1": "string",
>>  "lastName1": "string",
>>  "personalIdentificationNumber2": "string",
>>  "firstName2": "string",
>>  "lastName2": "string",
>>  "address": "string",
>>  "zipCode": "string",
>>  "city": "string",
>>  "homePhone": "+4521",
>>  "mobilePhone": "+45122",
>>  "campaing": "string",
>>  "dateForExtract": "string"
>>
>>  }
>>  ]
>> }
>>
>> However the swagger feature are generating this as example:
>>
>> {
>>"minimalContacts": [
>>  {
>>"campaignId": "string",
>>"id": 0,
>>"indexNumber": "string",
>>"accountNumber": "string",
>>"queueNumber": "string",
>>"balance": 0,
>>"personalIdentificationNumber1": "string",
>>"firstName1": "string",
>>"lastName1": "string",
>>"personalIdentificationNumber2": "string",
>>"firstName2": "string",
>>"lastName2": "string",
>>"address": "string",
>>"zipCode": "string",
>>"city": "string",
>>"homePhone": "string",
>>"mobilePhone": "string",
>>"campaing": "string",
>>"dateForExtract": "string"
>>  }
>>]
>> }
>>
>> MinimalContactWrapper
>>
>> @XmlAccessorType(XmlAccessType.FIELD)
>> @XmlRootElement(name = "contacts")
>> public class MinimalContactWrapper {
>>
>>  @XmlElementWrapper
>>  @XmlElementRef
>>  @Valid
>>  @NotNull
>>  @Size(min = 1)
>>  private List contactList=new ArrayList<>();
>>
>>  public List getMinimalContacts() {
>>  return contactList;
>>  }
>>
>>  public void setMinimalContacts(List
>> minimalContacts) {
>>  this.contactList = minimalContacts;
>>  }
>>
>>
>> MinimalContact
>>
>> 

Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
IS there somewhere while on runtime where I can print current registered
providers for cxf, I have a feeling that it somehow are using jettison for
json...

On Thu, Nov 30, 2017 at 12:17 PM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Okay I will check into libraries whats on class path.. I have the same gut
> feeling that it could be something like that.
>
> I have enunciate up and working on the side..
>
> On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin 
> wrote:
>
>> Yes, the minor Swagger version caused this change, what was working
>> 3.1.x, specifically the serializers approach, was not working any longer
>> with the new Swagger version, hence this update.
>>
>> I honestly do not know why exactly a JAXB annotated bean is not correctly
>> represented in the Swagger-generated #definitions, it's obviously something
>> to do with the way Jackson and JAXB interacts.
>> Perhaps Jackson you register with DOSGI is not the same version installed
>> by the CXF swagger2 feature, perhaps some diff JAXB versions are involved,
>> please keep experimenting
>>
>> Sergey
>>
>> defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
>>> swagger.setSwagger2Serializers(defaultSwagger2Serializers);
>>>
>>> I think this could be the same:
>>>
>>> Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
>>> swagger2Customizer.setJavadocProvider(new JavaDocProvider());
>>>
>>>
>>> swagger.setCustomizer(swagger2Customizer);
>>>
>>>
>>> I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)
>>>
>>>
>>> How can I tell swagger to do the same? I think that's the problem..
>>>
>>>
>>>
>>> regards Nino
>>>
>>>
>>>
>>>
>>> On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> Im wondering if this could be the problem :

 https://github.com/swagger-api/swagger-core/issues/960

 On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
 nino.martinez.w...@gmail.com> wrote:

 So I have a bean CXF accepts only this interpretation for my endpoint:
>
> {
>  "contactList": [
>  {
>  "campaignId": "2",
>  "id":"",
>  "indexNumber": "",
>  "accountNumber": "232",
>  "queueNumber": "0",
>  "balance": 0,
>  "personalIdentificationNumber1": "string",
>  "firstName1": "string",
>  "lastName1": "string",
>  "personalIdentificationNumber2": "string",
>  "firstName2": "string",
>  "lastName2": "string",
>  "address": "string",
>  "zipCode": "string",
>  "city": "string",
>  "homePhone": "+4521",
>  "mobilePhone": "+45122",
>  "campaing": "string",
>  "dateForExtract": "string"
>
>  }
>  ]
> }
>
> However the swagger feature are generating this as example:
>
> {
>"minimalContacts": [
>  {
>"campaignId": "string",
>"id": 0,
>"indexNumber": "string",
>"accountNumber": "string",
>"queueNumber": "string",
>"balance": 0,
>"personalIdentificationNumber1": "string",
>"firstName1": "string",
>"lastName1": "string",
>"personalIdentificationNumber2": "string",
>"firstName2": "string",
>"lastName2": "string",
>"address": "string",
>"zipCode": "string",
>"city": "string",
>"homePhone": "string",
>"mobilePhone": "string",
>"campaing": "string",
>"dateForExtract": "string"
>  }
>]
> }
>
> MinimalContactWrapper
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlRootElement(name = "contacts")
> public class MinimalContactWrapper {
>
>  @XmlElementWrapper
>  @XmlElementRef
>  @Valid
>  @NotNull
>  @Size(min = 1)
>  private List contactList=new ArrayList<>();
>
>  public List getMinimalContacts() {
>  return contactList;
>  }
>
>  public void setMinimalContacts(List
> minimalContacts) {
>  this.contactList = minimalContacts;
>  }
>
>
> MinimalContact
>
> @XmlAccessorType(XmlAccessType.PROPERTY)
> @XmlRootElement(name="minimalcontact")
> public class MinimalContact {
>
>  @NotNull
>  @Size(min=1, max=240)
>  private String campaignId;
>
>  private Long id;
>  @Size(min=1, max=240)
>  private String indexNumber;
>  @Size(min=1, max=20)
>  @NotNull
>  private String accountNumber;
>  @Size(min=1, max=8)
>  private String queueNumber;
>
>
>  privat

Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
Okay I will check into libraries whats on class path.. I have the same gut
feeling that it could be something like that.

I have enunciate up and working on the side..

On Thu, Nov 30, 2017 at 11:18 AM, Sergey Beryozkin 
wrote:

> Yes, the minor Swagger version caused this change, what was working 3.1.x,
> specifically the serializers approach, was not working any longer with the
> new Swagger version, hence this update.
>
> I honestly do not know why exactly a JAXB annotated bean is not correctly
> represented in the Swagger-generated #definitions, it's obviously something
> to do with the way Jackson and JAXB interacts.
> Perhaps Jackson you register with DOSGI is not the same version installed
> by the CXF swagger2 feature, perhaps some diff JAXB versions are involved,
> please keep experimenting
>
> Sergey
>
> defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
>> swagger.setSwagger2Serializers(defaultSwagger2Serializers);
>>
>> I think this could be the same:
>>
>> Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
>> swagger2Customizer.setJavadocProvider(new JavaDocProvider());
>>
>>
>> swagger.setCustomizer(swagger2Customizer);
>>
>>
>> I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)
>>
>>
>> How can I tell swagger to do the same? I think that's the problem..
>>
>>
>>
>> regards Nino
>>
>>
>>
>>
>> On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
>> nino.martinez.w...@gmail.com> wrote:
>>
>> Im wondering if this could be the problem :
>>>
>>> https://github.com/swagger-api/swagger-core/issues/960
>>>
>>> On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
>>> nino.martinez.w...@gmail.com> wrote:
>>>
>>> So I have a bean CXF accepts only this interpretation for my endpoint:

 {
  "contactList": [
  {
  "campaignId": "2",
  "id":"",
  "indexNumber": "",
  "accountNumber": "232",
  "queueNumber": "0",
  "balance": 0,
  "personalIdentificationNumber1": "string",
  "firstName1": "string",
  "lastName1": "string",
  "personalIdentificationNumber2": "string",
  "firstName2": "string",
  "lastName2": "string",
  "address": "string",
  "zipCode": "string",
  "city": "string",
  "homePhone": "+4521",
  "mobilePhone": "+45122",
  "campaing": "string",
  "dateForExtract": "string"

  }
  ]
 }

 However the swagger feature are generating this as example:

 {
"minimalContacts": [
  {
"campaignId": "string",
"id": 0,
"indexNumber": "string",
"accountNumber": "string",
"queueNumber": "string",
"balance": 0,
"personalIdentificationNumber1": "string",
"firstName1": "string",
"lastName1": "string",
"personalIdentificationNumber2": "string",
"firstName2": "string",
"lastName2": "string",
"address": "string",
"zipCode": "string",
"city": "string",
"homePhone": "string",
"mobilePhone": "string",
"campaing": "string",
"dateForExtract": "string"
  }
]
 }

 MinimalContactWrapper

 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "contacts")
 public class MinimalContactWrapper {

  @XmlElementWrapper
  @XmlElementRef
  @Valid
  @NotNull
  @Size(min = 1)
  private List contactList=new ArrayList<>();

  public List getMinimalContacts() {
  return contactList;
  }

  public void setMinimalContacts(List
 minimalContacts) {
  this.contactList = minimalContacts;
  }


 MinimalContact

 @XmlAccessorType(XmlAccessType.PROPERTY)
 @XmlRootElement(name="minimalcontact")
 public class MinimalContact {

  @NotNull
  @Size(min=1, max=240)
  private String campaignId;

  private Long id;
  @Size(min=1, max=240)
  private String indexNumber;
  @Size(min=1, max=20)
  @NotNull
  private String accountNumber;
  @Size(min=1, max=8)
  private String queueNumber;


  private Float balance;

  @Size(min=0, max=11)
  private String personalIdentificationNumber1;

  @Size(min=0, max=55)
  private String firstName1;

  @Size(min=0, max=55)
  private String lastName1;

  @Size(min=0, max=11)
  private String personalIdentificationNumber2;

  private String firstName2;

  private 

Apache CXF Fediz 1.4.3 and 1.3.3 released with a new security advisory CVE-2017-12631

2017-11-30 Thread Colm O hEigeartaigh
Apache CXF Fediz is a subproject of CXF. Fediz helps you to secure your web
applications and delegates security enforcement to the underlying
application server.

Apache CXF Fediz 1.4.3 and 1.3.3 are released along with a new security
advisory that is fixed in these releases:

CVE-2017-12631: CSRF vulnerabilities in the Apache CXF Fediz Spring plugins.

http://cxf.apache.org/security-advisories.data/CVE-2017-12631.txt.asc

Users who are using the Spring security plugins of Apache CXF Fediz should
upgrade immediately to the latest releases.

Colm.


-- 
Colm O hEigeartaigh

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


Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread Sergey Beryozkin
Yes, the minor Swagger version caused this change, what was working 
3.1.x, specifically the serializers approach, was not working any longer 
with the new Swagger version, hence this update.


I honestly do not know why exactly a JAXB annotated bean is not 
correctly represented in the Swagger-generated #definitions, it's 
obviously something to do with the way Jackson and JAXB interacts.
Perhaps Jackson you register with DOSGI is not the same version 
installed by the CXF swagger2 feature, perhaps some diff JAXB versions 
are involved, please keep experimenting


Sergey

defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
swagger.setSwagger2Serializers(defaultSwagger2Serializers);

I think this could be the same:

Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
swagger2Customizer.setJavadocProvider(new JavaDocProvider());


swagger.setCustomizer(swagger2Customizer);


I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)


How can I tell swagger to do the same? I think that's the problem..



regards Nino




On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:


Im wondering if this could be the problem :

https://github.com/swagger-api/swagger-core/issues/960

On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:


So I have a bean CXF accepts only this interpretation for my endpoint:

{
 "contactList": [
 {
 "campaignId": "2",
 "id":"",
 "indexNumber": "",
 "accountNumber": "232",
 "queueNumber": "0",
 "balance": 0,
 "personalIdentificationNumber1": "string",
 "firstName1": "string",
 "lastName1": "string",
 "personalIdentificationNumber2": "string",
 "firstName2": "string",
 "lastName2": "string",
 "address": "string",
 "zipCode": "string",
 "city": "string",
 "homePhone": "+4521",
 "mobilePhone": "+45122",
 "campaing": "string",
 "dateForExtract": "string"

 }
 ]
}

However the swagger feature are generating this as example:

{
   "minimalContacts": [
 {
   "campaignId": "string",
   "id": 0,
   "indexNumber": "string",
   "accountNumber": "string",
   "queueNumber": "string",
   "balance": 0,
   "personalIdentificationNumber1": "string",
   "firstName1": "string",
   "lastName1": "string",
   "personalIdentificationNumber2": "string",
   "firstName2": "string",
   "lastName2": "string",
   "address": "string",
   "zipCode": "string",
   "city": "string",
   "homePhone": "string",
   "mobilePhone": "string",
   "campaing": "string",
   "dateForExtract": "string"
 }
   ]
}

MinimalContactWrapper

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "contacts")
public class MinimalContactWrapper {

 @XmlElementWrapper
 @XmlElementRef
 @Valid
 @NotNull
 @Size(min = 1)
 private List contactList=new ArrayList<>();

 public List getMinimalContacts() {
 return contactList;
 }

 public void setMinimalContacts(List minimalContacts) {
 this.contactList = minimalContacts;
 }


MinimalContact

@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="minimalcontact")
public class MinimalContact {

 @NotNull
 @Size(min=1, max=240)
 private String campaignId;

 private Long id;
 @Size(min=1, max=240)
 private String indexNumber;
 @Size(min=1, max=20)
 @NotNull
 private String accountNumber;
 @Size(min=1, max=8)
 private String queueNumber;


 private Float balance;

 @Size(min=0, max=11)
 private String personalIdentificationNumber1;

 @Size(min=0, max=55)
 private String firstName1;

 @Size(min=0, max=55)
 private String lastName1;

 @Size(min=0, max=11)
 private String personalIdentificationNumber2;

 private String firstName2;

 private String lastName2;

 private String address;

 private String zipCode;
 private String city;

 @NotNull
 @Size(min=0, max=20)
 private String homePhone;

 @NotNull
 @Size(min=0, max=20)
 private String mobilePhone;

 private String campaing;

 @NotNull
 private String dateForExtract;






--
Best regards / Med venlig hilsen
Nino Martinez





--
Best regards / Med venlig hilsen
Nino Martinez







Re: SSL: SNI support in java 8 and CXF 3.1.7

2017-11-30 Thread Colm O hEigeartaigh
Hi Andrei,

It works in CXF 3.2.1 due to a fix I did which is also in CXF 3.1.10:

https://issues.apache.org/jira/browse/CXF-7233

Is it an option for you to upgrade to CXF 3.1.10?

Colm.

On Wed, Nov 29, 2017 at 9:57 PM, Andrei Shakirin 
wrote:

> Hi Colm,
>
> Perhaps you have an idea how to resolve the following issue:
>
> I try to setup SSL connection to server https://sandbox.tiramizoo.com/
> using CXF Rest client (CXF 3.1.7, WebClient or JAX-RS Client).
>
> The code running under JDK 1.8.0_131 fails:
> Caused by: javax.net.ssl.SSLException: Received fatal alert: internal_error
> at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
> at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
>
> Looking for the reason, I discovered that the reason of the problem is
> missing SNI during handshake:
>
> Log of success case:
> ...
> Extension server_name, server_name: [type=host_name (0), value=
> sandbox.tiramizoo.com]
>
> [write] MD5 and SHA1 hashes:  len = 191
> : 01 00 00 BB 03 03 5A 1E   8C 8D EB 9D 2A D8 DC E2  ..Z.*...
> 0010: D5 63 9B 7C 07 10 D9 25   A3 51 F3 C1 2B 1F B0 1A  .c.%.Q..+...
> 0020: 3F 57 CA BA 1E E7 00 00   3A C0 23 C0 27 00 3C C0  ?W..:.#.'.<.
> 0030: 25 C0 29 00 67 00 40 C0   09 C0 13 00 2F C0 04 C0  %.).g.@./...
> 0040: 0E 00 33 00 32 C0 2B C0   2F 00 9C C0 2D C0 31 00  ..3.2.+./...-.1.
> 0050: 9E 00 A2 C0 08 C0 12 00   0A C0 03 C0 0D 00 16 00  
> 0060: 13 00 FF 01 00 00 58 00   0A 00 16 00 14 00 17 00  ..X.
> 0070: 18 00 19 00 09 00 0A 00   0B 00 0C 00 0D 00 0E 00  
> 0080: 16 00 0B 00 02 01 00 00   0D 00 16 00 14 06 03 06  
> 0090: 01 05 03 05 01 04 03 04   01 04 02 02 03 02 01 02  
> 00A0: 02 00 00 00 1A 00 18 00   00 15 73 61 6E 64 62 6F  ..sandbo
> 00B0: 78 2E 74 69 72 61 6D 69   7A 6F 6F 2E 63 6F 6D x.tiramizoo.com
>
> Log of problem case:
> ...
> [NO Extension server_name]
> [write] MD5 and SHA1 hashes:  len = 203
> : 01 00 00 C7 03 03 5A 1E   8B 3F 08 56 DB C9 02 81  ..Z..?.V
> 0010: F7 6C F9 32 0F EC C3 1A   9A 7D 1C 04 C3 1B C7 D5  .l.2
> 0020: 6E 12 73 55 4C A3 00 00   64 C0 24 C0 28 00 3D C0  n.sUL...d.$.(.=.
> 0030: 26 C0 2A 00 6B 00 6A C0   0A C0 14 00 35 C0 05 C0  &.*.k.j.5...
> 0040: 0F 00 39 00 38 C0 23 C0   27 00 3C C0 25 C0 29 00  ..9.8.#.'.<.%.).
> 0050: 67 00 40 C0 09 C0 13 00   2F C0 04 C0 0E 00 33 00  g.@./.3.
> 0060: 32 C0 2C C0 2B C0 30 00   9D C0 2E C0 32 00 9F 00  2.,.+.0.2...
> 0070: A3 C0 2F 00 9C C0 2D C0   31 00 9E 00 A2 C0 08 C0  ../...-.1...
> 0080: 12 00 0A C0 03 C0 0D 00   16 00 13 00 FF 01 00 00  
> 0090: 3A 00 0A 00 16 00 14 00   17 00 18 00 19 00 09 00  :...
> 00A0: 0A 00 0B 00 0C 00 0D 00   0E 00 16 00 0B 00 02 01  
> 00B0: 00 00 0D 00 16 00 14 06   03 06 01 05 03 05 01 04  
> 00C0: 03 04 01 04 02 02 03 02   01 02 02 ...
>
>
> The problem is likely caused by bug in JDK https://bugs.openjdk.java.net/
> browse/JDK-8072464 that prevents sending SNI if client registers custom
> HostnameVerifier.
> I can also reproduce it with simple Java HttpsURLConnection + registring
> HostnameVerifier.
>
> Interesting that result of SSL connection to
> https://sandbox.tiramizoo.com/ looks like:
> 1) failed with CXF 3.1.7 and JDK 1.8.0_131
> 2) failed with simple HttpsURLConnection + registring HostnameVerifier and
> JDK 1.8.0_1311)
> 3) successful with CXF 3.2.1 and JDK 1.8.0_131
> 4) successful with CXF 3.2.1 and JDK 1.8.0_151
> 5) successful with simple HttpsURLConnection + registring HostnameVerifier
> and JDK 1.8.0_151
>
> Questions:
> - any idea why this connection works with CXF 3.2.1 and JDK 1.8.0_131,
> despite of fact that CXF 3.2.1 registers the custom HostnameVerifier as
> well?
> - are there any workaround for CXF 3.1.7 and JDK 1.8.0_131?
>
> Small example to reproduce the issue is attached.
>
> Regards,
> Andrei.
>
>


-- 
Colm O hEigeartaigh

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


Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
Okay I think something changed from cxf swagger 3.1.x to 3.2.x Earlier on I
could specify this :

DefaultSwagger2Serializers defaultSwagger2Serializers = new
DefaultSwagger2Serializers();
defaultSwagger2Serializers.setJavadocProvider(new JavaDocProvider());
swagger.setSwagger2Serializers(defaultSwagger2Serializers);

I think this could be the same:

Swagger2Customizer swagger2Customizer = new Swagger2Customizer();
swagger2Customizer.setJavadocProvider(new JavaDocProvider());


swagger.setCustomizer(swagger2Customizer);


I have setup CXF to use JACKSON (JacksonJaxbJsonProvider)


How can I tell swagger to do the same? I think that's the problem..



regards Nino




On Thu, Nov 30, 2017 at 10:50 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> Im wondering if this could be the problem :
>
> https://github.com/swagger-api/swagger-core/issues/960
>
> On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
> nino.martinez.w...@gmail.com> wrote:
>
>> So I have a bean CXF accepts only this interpretation for my endpoint:
>>
>> {
>> "contactList": [
>> {
>> "campaignId": "2",
>> "id":"",
>> "indexNumber": "",
>> "accountNumber": "232",
>> "queueNumber": "0",
>> "balance": 0,
>> "personalIdentificationNumber1": "string",
>> "firstName1": "string",
>> "lastName1": "string",
>> "personalIdentificationNumber2": "string",
>> "firstName2": "string",
>> "lastName2": "string",
>> "address": "string",
>> "zipCode": "string",
>> "city": "string",
>> "homePhone": "+4521",
>> "mobilePhone": "+45122",
>> "campaing": "string",
>> "dateForExtract": "string"
>>
>> }
>> ]
>> }
>>
>> However the swagger feature are generating this as example:
>>
>> {
>>   "minimalContacts": [
>> {
>>   "campaignId": "string",
>>   "id": 0,
>>   "indexNumber": "string",
>>   "accountNumber": "string",
>>   "queueNumber": "string",
>>   "balance": 0,
>>   "personalIdentificationNumber1": "string",
>>   "firstName1": "string",
>>   "lastName1": "string",
>>   "personalIdentificationNumber2": "string",
>>   "firstName2": "string",
>>   "lastName2": "string",
>>   "address": "string",
>>   "zipCode": "string",
>>   "city": "string",
>>   "homePhone": "string",
>>   "mobilePhone": "string",
>>   "campaing": "string",
>>   "dateForExtract": "string"
>> }
>>   ]
>> }
>>
>> MinimalContactWrapper
>>
>> @XmlAccessorType(XmlAccessType.FIELD)
>> @XmlRootElement(name = "contacts")
>> public class MinimalContactWrapper {
>>
>> @XmlElementWrapper
>> @XmlElementRef
>> @Valid
>> @NotNull
>> @Size(min = 1)
>> private List contactList=new ArrayList<>();
>>
>> public List getMinimalContacts() {
>> return contactList;
>> }
>>
>> public void setMinimalContacts(List minimalContacts) {
>> this.contactList = minimalContacts;
>> }
>>
>>
>> MinimalContact
>>
>> @XmlAccessorType(XmlAccessType.PROPERTY)
>> @XmlRootElement(name="minimalcontact")
>> public class MinimalContact {
>>
>> @NotNull
>> @Size(min=1, max=240)
>> private String campaignId;
>>
>> private Long id;
>> @Size(min=1, max=240)
>> private String indexNumber;
>> @Size(min=1, max=20)
>> @NotNull
>> private String accountNumber;
>> @Size(min=1, max=8)
>> private String queueNumber;
>>
>>
>> private Float balance;
>>
>> @Size(min=0, max=11)
>> private String personalIdentificationNumber1;
>>
>> @Size(min=0, max=55)
>> private String firstName1;
>>
>> @Size(min=0, max=55)
>> private String lastName1;
>>
>> @Size(min=0, max=11)
>> private String personalIdentificationNumber2;
>>
>> private String firstName2;
>>
>> private String lastName2;
>>
>> private String address;
>>
>> private String zipCode;
>> private String city;
>>
>> @NotNull
>> @Size(min=0, max=20)
>> private String homePhone;
>>
>> @NotNull
>> @Size(min=0, max=20)
>> private String mobilePhone;
>>
>> private String campaing;
>>
>> @NotNull
>> private String dateForExtract;
>>
>>
>>
>>
>>
>>
>> --
>> Best regards / Med venlig hilsen
>> Nino Martinez
>>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>



-- 
Best regards / Med venlig hilsen
Nino Martinez


Re: CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
Im wondering if this could be the problem :

https://github.com/swagger-api/swagger-core/issues/960

On Thu, Nov 30, 2017 at 10:38 AM, nino martinez wael <
nino.martinez.w...@gmail.com> wrote:

> So I have a bean CXF accepts only this interpretation for my endpoint:
>
> {
> "contactList": [
> {
> "campaignId": "2",
> "id":"",
> "indexNumber": "",
> "accountNumber": "232",
> "queueNumber": "0",
> "balance": 0,
> "personalIdentificationNumber1": "string",
> "firstName1": "string",
> "lastName1": "string",
> "personalIdentificationNumber2": "string",
> "firstName2": "string",
> "lastName2": "string",
> "address": "string",
> "zipCode": "string",
> "city": "string",
> "homePhone": "+4521",
> "mobilePhone": "+45122",
> "campaing": "string",
> "dateForExtract": "string"
>
> }
> ]
> }
>
> However the swagger feature are generating this as example:
>
> {
>   "minimalContacts": [
> {
>   "campaignId": "string",
>   "id": 0,
>   "indexNumber": "string",
>   "accountNumber": "string",
>   "queueNumber": "string",
>   "balance": 0,
>   "personalIdentificationNumber1": "string",
>   "firstName1": "string",
>   "lastName1": "string",
>   "personalIdentificationNumber2": "string",
>   "firstName2": "string",
>   "lastName2": "string",
>   "address": "string",
>   "zipCode": "string",
>   "city": "string",
>   "homePhone": "string",
>   "mobilePhone": "string",
>   "campaing": "string",
>   "dateForExtract": "string"
> }
>   ]
> }
>
> MinimalContactWrapper
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlRootElement(name = "contacts")
> public class MinimalContactWrapper {
>
> @XmlElementWrapper
> @XmlElementRef
> @Valid
> @NotNull
> @Size(min = 1)
> private List contactList=new ArrayList<>();
>
> public List getMinimalContacts() {
> return contactList;
> }
>
> public void setMinimalContacts(List minimalContacts) {
> this.contactList = minimalContacts;
> }
>
>
> MinimalContact
>
> @XmlAccessorType(XmlAccessType.PROPERTY)
> @XmlRootElement(name="minimalcontact")
> public class MinimalContact {
>
> @NotNull
> @Size(min=1, max=240)
> private String campaignId;
>
> private Long id;
> @Size(min=1, max=240)
> private String indexNumber;
> @Size(min=1, max=20)
> @NotNull
> private String accountNumber;
> @Size(min=1, max=8)
> private String queueNumber;
>
>
> private Float balance;
>
> @Size(min=0, max=11)
> private String personalIdentificationNumber1;
>
> @Size(min=0, max=55)
> private String firstName1;
>
> @Size(min=0, max=55)
> private String lastName1;
>
> @Size(min=0, max=11)
> private String personalIdentificationNumber2;
>
> private String firstName2;
>
> private String lastName2;
>
> private String address;
>
> private String zipCode;
> private String city;
>
> @NotNull
> @Size(min=0, max=20)
> private String homePhone;
>
> @NotNull
> @Size(min=0, max=20)
> private String mobilePhone;
>
> private String campaing;
>
> @NotNull
> private String dateForExtract;
>
>
>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>



-- 
Best regards / Med venlig hilsen
Nino Martinez


CXF 3.2.1 swagger generation are wrong for json

2017-11-30 Thread nino martinez wael
So I have a bean CXF accepts only this interpretation for my endpoint:

{
"contactList": [
{
"campaignId": "2",
"id":"",
"indexNumber": "",
"accountNumber": "232",
"queueNumber": "0",
"balance": 0,
"personalIdentificationNumber1": "string",
"firstName1": "string",
"lastName1": "string",
"personalIdentificationNumber2": "string",
"firstName2": "string",
"lastName2": "string",
"address": "string",
"zipCode": "string",
"city": "string",
"homePhone": "+4521",
"mobilePhone": "+45122",
"campaing": "string",
"dateForExtract": "string"

}
]
}

However the swagger feature are generating this as example:

{
  "minimalContacts": [
{
  "campaignId": "string",
  "id": 0,
  "indexNumber": "string",
  "accountNumber": "string",
  "queueNumber": "string",
  "balance": 0,
  "personalIdentificationNumber1": "string",
  "firstName1": "string",
  "lastName1": "string",
  "personalIdentificationNumber2": "string",
  "firstName2": "string",
  "lastName2": "string",
  "address": "string",
  "zipCode": "string",
  "city": "string",
  "homePhone": "string",
  "mobilePhone": "string",
  "campaing": "string",
  "dateForExtract": "string"
}
  ]
}

MinimalContactWrapper

@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "contacts")
public class MinimalContactWrapper {

@XmlElementWrapper
@XmlElementRef
@Valid
@NotNull
@Size(min = 1)
private List contactList=new ArrayList<>();

public List getMinimalContacts() {
return contactList;
}

public void setMinimalContacts(List minimalContacts) {
this.contactList = minimalContacts;
}


MinimalContact

@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="minimalcontact")
public class MinimalContact {

@NotNull
@Size(min=1, max=240)
private String campaignId;

private Long id;
@Size(min=1, max=240)
private String indexNumber;
@Size(min=1, max=20)
@NotNull
private String accountNumber;
@Size(min=1, max=8)
private String queueNumber;


private Float balance;

@Size(min=0, max=11)
private String personalIdentificationNumber1;

@Size(min=0, max=55)
private String firstName1;

@Size(min=0, max=55)
private String lastName1;

@Size(min=0, max=11)
private String personalIdentificationNumber2;

private String firstName2;

private String lastName2;

private String address;

private String zipCode;
private String city;

@NotNull
@Size(min=0, max=20)
private String homePhone;

@NotNull
@Size(min=0, max=20)
private String mobilePhone;

private String campaing;

@NotNull
private String dateForExtract;






-- 
Best regards / Med venlig hilsen
Nino Martinez


Re: CXF DOSGI

2017-11-30 Thread nino martinez wael
As you mentioned earlier on, make sure the desired CXF version are
installed before installing DOSGI . like so in the assembly pom:


org.apache.cxf.karaf
apache-cxf
features
xml
runtime
${cxf.version}



And then



org.apache.karaf.tooling
karaf-maven-plugin
true


wrapper
*cxf*

...


On Thu, Nov 30, 2017 at 9:04 AM, Christian Schneider <
ch...@die-schneider.net> wrote:

> Nice .. Do you have any lessons learned for other who try this?
>
> Christian
>
> 2017-11-28 14:39 GMT+01:00 nino martinez wael <
> nino.martinez.w...@gmail.com>
> :
>
> > I actually got it working..
> >
> > On Wed, Nov 22, 2017 at 1:07 PM, nino martinez wael <
> > nino.martinez.w...@gmail.com> wrote:
> >
> > > I can't seem to get it to work..
> > >
> > >
> > >
> > >
> > > On Fri, Nov 10, 2017 at 10:54 AM, Christian Schneider <
> > > ch...@die-schneider.net> wrote:
> > >
> > >> Yes it would but karaf would then select the newer version. Can you
> try
> > if
> > >> this works for you? If not I will do a CXF-DOSGi release.
> > >>
> > >> Christian
> > >>
> > >> 2017-11-10 7:00 GMT+01:00 nino martinez wael <
> > >> nino.martinez.w...@gmail.com>:
> > >>
> > >> > Yes.. But would'nt CXF-DOSGI pull in it's on repo in the older
> > version?
> > >> We
> > >> > are building an an offline karaf assembly.
> > >> >
> > >> > https://github.com/apache/cxf-dosgi/blob/master/distribution
> > >> /features/src/
> > >> > main/resources/features.xml
> > >> > Line 3?
> > >> >
> > >> > -regards Nino
> > >> >
> > >> > On Wed, Nov 8, 2017 at 5:25 PM, Christian Schneider <
> > >> > ch...@die-schneider.net
> > >> > > wrote:
> > >> >
> > >> > > Do you use CXF-DOSGi with Karaf?
> > >> > > If yes then you can simply add the cxf repository in version 3.2.1
> > in
> > >> > > addition to cxf-dosgi. Karaf should then use the newer cxf.
> > >> > >
> > >> > > Christian
> > >> > >
> > >> > > 2017-11-08 9:27 GMT+01:00 nino martinez wael <
> > >> > nino.martinez.w...@gmail.com
> > >> > > >:
> > >> > >
> > >> > > > Hi
> > >> > > >
> > >> > > > Could we get an new release that depends on CXF 3.2.1..
> > >> > > >
> > >> > > > It has an crucial update regarding swagger..
> > >> > > >
> > >> > > > --
> > >> > > > Best regards / Med venlig hilsen
> > >> > > > Nino Martinez
> > >> > > >
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > --
> > >> > > Christian Schneider
> > >> > > http://www.liquid-reality.de
> > >> > >  > >> 2bd062c5a7e
> > >> > > 46&URL=http%3a%2f%2fwww.liquid-reality.de>
> > >> > >
> > >> > > Computer Scientist
> > >> > > http://www.adobe.com
> > >> > >
> > >> >
> > >> >
> > >> >
> > >> > --
> > >> > Best regards / Med venlig hilsen
> > >> > Nino Martinez
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> --
> > >> Christian Schneider
> > >> http://www.liquid-reality.de
> > >>  > >> 2bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
> > >>
> > >> Computer Scientist
> > >> http://www.adobe.com
> > >>
> > >
> > >
> > >
> > > --
> > > Best regards / Med venlig hilsen
> > > Nino Martinez
> > >
> >
> >
> >
> > --
> > Best regards / Med venlig hilsen
> > Nino Martinez
> >
>
>
>
> --
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Computer Scientist
> http://www.adobe.com
>



-- 
Best regards / Med venlig hilsen
Nino Martinez


Re: CXF DOSGI

2017-11-30 Thread Christian Schneider
Nice .. Do you have any lessons learned for other who try this?

Christian

2017-11-28 14:39 GMT+01:00 nino martinez wael 
:

> I actually got it working..
>
> On Wed, Nov 22, 2017 at 1:07 PM, nino martinez wael <
> nino.martinez.w...@gmail.com> wrote:
>
> > I can't seem to get it to work..
> >
> >
> >
> >
> > On Fri, Nov 10, 2017 at 10:54 AM, Christian Schneider <
> > ch...@die-schneider.net> wrote:
> >
> >> Yes it would but karaf would then select the newer version. Can you try
> if
> >> this works for you? If not I will do a CXF-DOSGi release.
> >>
> >> Christian
> >>
> >> 2017-11-10 7:00 GMT+01:00 nino martinez wael <
> >> nino.martinez.w...@gmail.com>:
> >>
> >> > Yes.. But would'nt CXF-DOSGI pull in it's on repo in the older
> version?
> >> We
> >> > are building an an offline karaf assembly.
> >> >
> >> > https://github.com/apache/cxf-dosgi/blob/master/distribution
> >> /features/src/
> >> > main/resources/features.xml
> >> > Line 3?
> >> >
> >> > -regards Nino
> >> >
> >> > On Wed, Nov 8, 2017 at 5:25 PM, Christian Schneider <
> >> > ch...@die-schneider.net
> >> > > wrote:
> >> >
> >> > > Do you use CXF-DOSGi with Karaf?
> >> > > If yes then you can simply add the cxf repository in version 3.2.1
> in
> >> > > addition to cxf-dosgi. Karaf should then use the newer cxf.
> >> > >
> >> > > Christian
> >> > >
> >> > > 2017-11-08 9:27 GMT+01:00 nino martinez wael <
> >> > nino.martinez.w...@gmail.com
> >> > > >:
> >> > >
> >> > > > Hi
> >> > > >
> >> > > > Could we get an new release that depends on CXF 3.2.1..
> >> > > >
> >> > > > It has an crucial update regarding swagger..
> >> > > >
> >> > > > --
> >> > > > Best regards / Med venlig hilsen
> >> > > > Nino Martinez
> >> > > >
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > --
> >> > > Christian Schneider
> >> > > http://www.liquid-reality.de
> >> > >  >> 2bd062c5a7e
> >> > > 46&URL=http%3a%2f%2fwww.liquid-reality.de>
> >> > >
> >> > > Computer Scientist
> >> > > http://www.adobe.com
> >> > >
> >> >
> >> >
> >> >
> >> > --
> >> > Best regards / Med venlig hilsen
> >> > Nino Martinez
> >> >
> >>
> >>
> >>
> >> --
> >> --
> >> Christian Schneider
> >> http://www.liquid-reality.de
> >>  >> 2bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>
> >>
> >> Computer Scientist
> >> http://www.adobe.com
> >>
> >
> >
> >
> > --
> > Best regards / Med venlig hilsen
> > Nino Martinez
> >
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com