Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groovy beans with boolean properties cannot be processed into json #4814

Open
optyler opened this issue Nov 27, 2024 · 1 comment
Open

Groovy beans with boolean properties cannot be processed into json #4814

optyler opened this issue Nov 27, 2024 · 1 comment
Labels
need-test-case To work on issue, a reproduction (ideally unit test) needed

Comments

@optyler
Copy link

optyler commented Nov 27, 2024

Hello, this issue is exactly the same as this old one

I'm experencing it with the v2.16

here is the stacktrace :

ERROR:ApiController:body():Erreur generale:org.codehaus.jackson.map.JsonMappingException: Conflicting getter definitions for property "active": com.qwam.qesapi_v2.collection.dto.CollectionDto#getActive(0 params) vs com.qwam.qesapi_v2.collection.dto.CollectionDto#isActive(0 params) (through reference chain: java.util.ArrayList[0])
org.codehaus.jackson.map.JsonMappingException: Conflicting getter definitions for property "active": com.qwam.qesapi_v2.collection.dto.CollectionDto#getActive(0 params) vs com.qwam.qesapi_v2.collection.dto.CollectionDto#isActive(0 params) (through reference chain: java.util.ArrayList[0])
	at org.codehaus.jackson.map.ser.StdSerializerProvider._createAndCacheUntypedSerializer(StdSerializerProvider.java:740)
	at org.codehaus.jackson.map.ser.StdSerializerProvider.findValueSerializer(StdSerializerProvider.java:344)
	at org.codehaus.jackson.map.ser.impl.PropertySerializerMap.findAndAddSerializer(PropertySerializerMap.java:39)
	at org.codehaus.jackson.map.ser.std.AsArraySerializerBase._findAndAddDynamic(AsArraySerializerBase.java:165)

My POGO is :

@MapConstructor
class CollectionDto {
    // ...
    String libelle
    Date date_creation

    @JsonIgnore
    long utilisateur

    boolean active = false
    // ...
}
@cowtowncoder
Copy link
Member

cowtowncoder commented Nov 28, 2024

@optyler You are using Jackson 1.x, not 2.x:

ERROR:ApiController:body():Erreur generale:org.codehaus.jackson.map.JsonMappingException: Conflicting getter definitions for property "active": com.qwam.qesapi_v2.collection.dto.CollectionDto#getActive(0 params) vs com.qwam.qesapi_v2.collection.dto.CollectionDto#isActive(0 params) (through reference chain: java.util.ArrayList[0])
org.codehaus.jackson.map.JsonMappingException:  ...

(see those org.codehaus.jackson packages?)

Going forward, issues like this need to be filed against jackson-databind, not here (jackson-core); I'll transfer.

Finally: 2.16.x is not the latest so would need to reproduce with 2.17.x or (ideally) 2.18.1.

@cowtowncoder cowtowncoder transferred this issue from FasterXML/jackson-core Nov 28, 2024
@cowtowncoder cowtowncoder added the need-test-case To work on issue, a reproduction (ideally unit test) needed label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-test-case To work on issue, a reproduction (ideally unit test) needed
Projects
None yet
Development

No branches or pull requests

2 participants