cxf version change between 7.0.5 to 7.1.0

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

cxf version change between 7.0.5 to 7.1.0

Matthew Broadhead-2
i am using keycloak 4.5.0 for my security.  when i post a
org.keycloak.representations.idm.UserRepresentation using cxf webclient
it works using 7.0.5 but not with 7.1.0

e.g.
userRepresentation.setEnabled(true);
userRepresentation.setEmailVerified(true);
Response response =
wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);

it seems that the version of cxf in 7.0.5 successfully converts the
boolean fields to true, but the one in 7.1.0 doesn't

i can post to the cxf list but do you know what the version numbers are?

also it seems that keycloak have their getters and setters all messed
up, they are using a Boolean object but setting like a primitive e.g.
public Boolean isEnabled() {
     return enabled;
}
public void setEnabled(Boolean enabled) {
     this.enabled = enabled;
}
Reply | Threaded
Open this post in threaded view
|

Re: cxf version change between 7.0.5 to 7.1.0

Matthew Broadhead-2
actually wouldn't it be johnzon that has changed its behaviour?

On 22/05/2019 17:19, Matthew Broadhead wrote:

> i am using keycloak 4.5.0 for my security.  when i post a
> org.keycloak.representations.idm.UserRepresentation using cxf
> webclient it works using 7.0.5 but not with 7.1.0
>
> e.g.
> userRepresentation.setEnabled(true);
> userRepresentation.setEmailVerified(true);
> Response response =
> wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);
>
> it seems that the version of cxf in 7.0.5 successfully converts the
> boolean fields to true, but the one in 7.1.0 doesn't
>
> i can post to the cxf list but do you know what the version numbers are?
>
> also it seems that keycloak have their getters and setters all messed
> up, they are using a Boolean object but setting like a primitive e.g.
> public Boolean isEnabled() {
>     return enabled;
> }
> public void setEnabled(Boolean enabled) {
>     this.enabled = enabled;
> }

Reply | Threaded
Open this post in threaded view
|

Re: cxf version change between 7.0.5 to 7.1.0

Cesar Hernandez
Hi Matthew,
Replying in line:

it seems that the version of cxf in 7.0.5 successfully converts the
> boolean fields to true, but the one in 7.1.0 doesn't

As far as I see, TomEE 7.0.5 [1] and  7.1.0 [2] are both using cxf 3.1.15
version and johnzon 1.0.1


it works using 7.0.5 but not with 7.1.0

Can you please share the logs you are getting when the client is not
working on 7.1.0.
An example project would be useful to replicate the scenario locally too.


[1]
https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L106
https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L136

[2]
https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L107
https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L137


El mié., 22 may. 2019 a las 11:31, Matthew Broadhead
(<[hidden email]>) escribió:

> actually wouldn't it be johnzon that has changed its behaviour?
>
> On 22/05/2019 17:19, Matthew Broadhead wrote:
> > i am using keycloak 4.5.0 for my security.  when i post a
> > org.keycloak.representations.idm.UserRepresentation using cxf
> > webclient it works using 7.0.5 but not with 7.1.0
> >
> > e.g.
> > userRepresentation.setEnabled(true);
> > userRepresentation.setEmailVerified(true);
> > Response response =
> > wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);
> >
> > it seems that the version of cxf in 7.0.5 successfully converts the
> > boolean fields to true, but the one in 7.1.0 doesn't
> >
> > i can post to the cxf list but do you know what the version numbers are?
> >
> > also it seems that keycloak have their getters and setters all messed
> > up, they are using a Boolean object but setting like a primitive e.g.
> > public Boolean isEnabled() {
> >     return enabled;
> > }
> > public void setEnabled(Boolean enabled) {
> >     this.enabled = enabled;
> > }
>
>

--
Atentamente:
César Hernández.
Reply | Threaded
Open this post in threaded view
|

Re: cxf version change between 7.0.5 to 7.1.0

Matthew Broadhead-2
yes i agree the version numbers look the same.

but there are some big changes somewhere affecting the JSON output
because for example java.util.Date is being converted differently in
7.0.5 and 7.1.0

in moment.js for 7.0.5 i have to use
moment(value.time).format('lll')

whereas in 7.1.0 i can use
moment(value).format('lll')

the handling of booleans must be the same although keycloak are using a
strange format for their getter and setters

On 28/05/2019 17:29, César Hernández Mendoza wrote:

> Hi Matthew,
> Replying in line:
>
> it seems that the version of cxf in 7.0.5 successfully converts the
>> boolean fields to true, but the one in 7.1.0 doesn't
> As far as I see, TomEE 7.0.5 [1] and  7.1.0 [2] are both using cxf 3.1.15
> version and johnzon 1.0.1
>
>
> it works using 7.0.5 but not with 7.1.0
>
> Can you please share the logs you are getting when the client is not
> working on 7.1.0.
> An example project would be useful to replicate the scenario locally too.
>
>
> [1]
> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L106
> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L136
>
> [2]
> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L107
> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L137
>
>
> El mié., 22 may. 2019 a las 11:31, Matthew Broadhead
> (<[hidden email]>) escribió:
>
>> actually wouldn't it be johnzon that has changed its behaviour?
>>
>> On 22/05/2019 17:19, Matthew Broadhead wrote:
>>> i am using keycloak 4.5.0 for my security.  when i post a
>>> org.keycloak.representations.idm.UserRepresentation using cxf
>>> webclient it works using 7.0.5 but not with 7.1.0
>>>
>>> e.g.
>>> userRepresentation.setEnabled(true);
>>> userRepresentation.setEmailVerified(true);
>>> Response response =
>>> wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);
>>>
>>> it seems that the version of cxf in 7.0.5 successfully converts the
>>> boolean fields to true, but the one in 7.1.0 doesn't
>>>
>>> i can post to the cxf list but do you know what the version numbers are?
>>>
>>> also it seems that keycloak have their getters and setters all messed
>>> up, they are using a Boolean object but setting like a primitive e.g.
>>> public Boolean isEnabled() {
>>>      return enabled;
>>> }
>>> public void setEnabled(Boolean enabled) {
>>>      this.enabled = enabled;
>>> }
>>

Reply | Threaded
Open this post in threaded view
|

Re: cxf version change between 7.0.5 to 7.1.0

kerickson
Something did change relating to Johnzon between these two versions. It
became more strict about getter / setter naming convention, specifically
such that a getter called getID for a prop called id needed to be renamed
with a lowercase D in order to have the property be included in a response.

On Fri, May 31, 2019, 3:54 PM Matthew Broadhead
<[hidden email]> wrote:

> yes i agree the version numbers look the same.
>
> but there are some big changes somewhere affecting the JSON output
> because for example java.util.Date is being converted differently in
> 7.0.5 and 7.1.0
>
> in moment.js for 7.0.5 i have to use
> moment(value.time).format('lll')
>
> whereas in 7.1.0 i can use
> moment(value).format('lll')
>
> the handling of booleans must be the same although keycloak are using a
> strange format for their getter and setters
>
> On 28/05/2019 17:29, César Hernández Mendoza wrote:
> > Hi Matthew,
> > Replying in line:
> >
> > it seems that the version of cxf in 7.0.5 successfully converts the
> >> boolean fields to true, but the one in 7.1.0 doesn't
> > As far as I see, TomEE 7.0.5 [1] and  7.1.0 [2] are both using cxf 3.1.15
> > version and johnzon 1.0.1
> >
> >
> > it works using 7.0.5 but not with 7.1.0
> >
> > Can you please share the logs you are getting when the client is not
> > working on 7.1.0.
> > An example project would be useful to replicate the scenario locally too.
> >
> >
> > [1]
> >
> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L106
> >
> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L136
> >
> > [2]
> >
> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L107
> >
> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L137
> >
> >
> > El mié., 22 may. 2019 a las 11:31, Matthew Broadhead
> > (<[hidden email]>) escribió:
> >
> >> actually wouldn't it be johnzon that has changed its behaviour?
> >>
> >> On 22/05/2019 17:19, Matthew Broadhead wrote:
> >>> i am using keycloak 4.5.0 for my security.  when i post a
> >>> org.keycloak.representations.idm.UserRepresentation using cxf
> >>> webclient it works using 7.0.5 but not with 7.1.0
> >>>
> >>> e.g.
> >>> userRepresentation.setEnabled(true);
> >>> userRepresentation.setEmailVerified(true);
> >>> Response response =
> >>> wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);
> >>>
> >>> it seems that the version of cxf in 7.0.5 successfully converts the
> >>> boolean fields to true, but the one in 7.1.0 doesn't
> >>>
> >>> i can post to the cxf list but do you know what the version numbers
> are?
> >>>
> >>> also it seems that keycloak have their getters and setters all messed
> >>> up, they are using a Boolean object but setting like a primitive e.g.
> >>> public Boolean isEnabled() {
> >>>      return enabled;
> >>> }
> >>> public void setEnabled(Boolean enabled) {
> >>>      this.enabled = enabled;
> >>> }
> >>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: cxf version change between 7.0.5 to 7.1.0

Matthew Broadhead-2
i wonder where it has been changed if the version numbers are the same?

this is the class that is giving me problems:
https://github.com/keycloak/keycloak/blob/master/core/src/main/java/org/keycloak/representations/idm/UserRepresentation.java

if you look at the getters and setters for Boolean values enabled and
emailVerified you will see they use isEnabled and isEmailVerified
instead of getEnabled and getEmailVerified (as i would expect with a
Boolean object instead of boolean primitive)

basically my choice is to stay on 7.0.5 or write a wrapper to fix
Keycloak object.  i have submitted the problem to them but they don't care.

On 01/06/2019 01:50, Kean Erickson wrote:

> Something did change relating to Johnzon between these two versions. It
> became more strict about getter / setter naming convention, specifically
> such that a getter called getID for a prop called id needed to be renamed
> with a lowercase D in order to have the property be included in a response.
>
> On Fri, May 31, 2019, 3:54 PM Matthew Broadhead
> <[hidden email]> wrote:
>
>> yes i agree the version numbers look the same.
>>
>> but there are some big changes somewhere affecting the JSON output
>> because for example java.util.Date is being converted differently in
>> 7.0.5 and 7.1.0
>>
>> in moment.js for 7.0.5 i have to use
>> moment(value.time).format('lll')
>>
>> whereas in 7.1.0 i can use
>> moment(value).format('lll')
>>
>> the handling of booleans must be the same although keycloak are using a
>> strange format for their getter and setters
>>
>> On 28/05/2019 17:29, César Hernández Mendoza wrote:
>>> Hi Matthew,
>>> Replying in line:
>>>
>>> it seems that the version of cxf in 7.0.5 successfully converts the
>>>> boolean fields to true, but the one in 7.1.0 doesn't
>>> As far as I see, TomEE 7.0.5 [1] and  7.1.0 [2] are both using cxf 3.1.15
>>> version and johnzon 1.0.1
>>>
>>>
>>> it works using 7.0.5 but not with 7.1.0
>>>
>>> Can you please share the logs you are getting when the client is not
>>> working on 7.1.0.
>>> An example project would be useful to replicate the scenario locally too.
>>>
>>>
>>> [1]
>>>
>> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L106
>> https://github.com/apache/tomee/blob/f6d053a6289d7ff5f0bd71ad041ca80831427bf9/pom.xml#L136
>>> [2]
>>>
>> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L107
>> https://github.com/apache/tomee/blob/8c6358cca46e431df78fc9c7d818259a9ba8635b/pom.xml#L137
>>>
>>> El mié., 22 may. 2019 a las 11:31, Matthew Broadhead
>>> (<[hidden email]>) escribió:
>>>
>>>> actually wouldn't it be johnzon that has changed its behaviour?
>>>>
>>>> On 22/05/2019 17:19, Matthew Broadhead wrote:
>>>>> i am using keycloak 4.5.0 for my security.  when i post a
>>>>> org.keycloak.representations.idm.UserRepresentation using cxf
>>>>> webclient it works using 7.0.5 but not with 7.1.0
>>>>>
>>>>> e.g.
>>>>> userRepresentation.setEnabled(true);
>>>>> userRepresentation.setEmailVerified(true);
>>>>> Response response =
>>>>> wc.type(MediaType.APPLICATION_JSON).post(userRepresentation);
>>>>>
>>>>> it seems that the version of cxf in 7.0.5 successfully converts the
>>>>> boolean fields to true, but the one in 7.1.0 doesn't
>>>>>
>>>>> i can post to the cxf list but do you know what the version numbers
>> are?
>>>>> also it seems that keycloak have their getters and setters all messed
>>>>> up, they are using a Boolean object but setting like a primitive e.g.
>>>>> public Boolean isEnabled() {
>>>>>       return enabled;
>>>>> }
>>>>> public void setEnabled(Boolean enabled) {
>>>>>       this.enabled = enabled;
>>>>> }
>>