Help to undrerstand how to use domino-jackson and the annotation JSONMapper

77 views
Skip to first unread message

Marco Tenti (IoProgrammo88)

unread,
Apr 12, 2024, 7:20:27 AMApr 12
to GWT Users
I'm upgrading a old project and i want to replace the old gwt-jackson (https://dominokit.com/solutions/domino-jackson/v1)  with the domino-jackson project (https://github.com/DominoKit/domino-jackson).

It should be a simple transiction, but i cannot understand how to let the GWT compilation "see" the implementations classes of the ObjectMapper interface.

Here the "old" code from gwt-jackson

public static interface AltriMetadatiDTOMapper extends com.github.nmorel.gwtjackson.client.ObjectMapper<Map<String,List<MetadatoDTOGWT>>> {} 

 ... 

 AltriMetadatiDTOMapper altriMetadatiDTOMapper = GWT.create(AltriMetadatiDTOMapper.class); String jsonAltriMetadati = altriMetadatiDTOMapper.write(object);

Here the "new" code from domino-jackson

@org.dominokit.jackson.annotation.JSONMapper public interface AltriMetadatiDTOMapper extends org.dominokit.jackson.ObjectMapper<Map<String,List<MetadatoDTOGWT>>> {}

 ... 

 AltriMetadatiDTOMapper altriMetadatiDTOMapper = GWT.create(AltriMetadatiDTOMappe.class); String jsonAltriMetadati = altriMetadatiDTOMapper.write(object);

but it give to me this error

[ERROR] Errors in 'xxx.java' [INFO] [ERROR] Line 662: Rebind result 'xxx.AltriMetadatiDTOMapper' must be a class

Did anyone know what i'm doing wrong ?

Thomas Broyer

unread,
Apr 12, 2024, 12:25:30 PMApr 12
to GWT Users
Aren't you supposed to directly use the generated class rather than using GWT.create() ? (unless you also added a <replace-with> in your gwt.xml)

Marco Tenti (IoProgrammo88)

unread,
Apr 15, 2024, 3:16:49 AMApr 15
to GWT Users
The problem i cannot find the generate class "Person_MapperImpl" is under the target folder somewhere ?

Marco Tenti (IoProgrammo88)

unread,
Apr 15, 2024, 3:24:22 AMApr 15
to GWT Users
I also try to use the external approach described here https://dominokit.com/solutions/domino-jackson/v1/docs/getting-started/define-mappers but it should be the same i must have the XXMapperImpl somewhere , but the java compiler tell me that class do not exists. Maybe there is some maven configuration to add somewehre ?
Message has been deleted

Frank Hossfeld

unread,
Apr 15, 2024, 10:31:32 AMApr 15
to GWT Users
Are you certain, that the annotation processor had ran?
I have not digged into domino-jackson, but I think, the @JsonMapper annotation triggers a annotation processor. The generated classes will be found under  'target/generated-sources/annotatins'
Reply all
Reply to author
Forward
0 new messages