Closed bigalnz closed 4 months ago
You write "All my error messages reference Geolatte in the stack trace" but the stack trace you posted doesn't reference geolatte at all.
If I try this :
@Bean
Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
CoordinateReferenceSystem<G2D> crs = WGS84;
return builder -> builder
.deserializers(new GeometryDeserializer(WGS84, settings));
}
Which is one way to load the GeolatteGeomModule the second param in GeometryDeserializer is a Settings
but I dont seem to be able to import the settings class?
There is a settings class in the GeolatteGeomJson dependency - but I don't seem to be able to import it to provide the second param.
You write "All my error messages reference Geolatte in the stack trace" but the stack trace you posted doesn't reference geolatte at all.
Yes I accept that - but the last 2 days of trying to get this working, in all the different attempts - many of the messages have references GeoLatteGeomModule.
Once I get this going I would like to write a simple use case for Spring Boot for the docs.
Also articles like here : https://www.baeldung.com/spring-boot-customize-jackson-objectmapper
Reference injecting modules like this:
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder().serializers(LOCAL_DATETIME_SERIALIZER)
.serializationInclusion(JsonInclude.Include.NON_NULL);
return new MappingJackson2HttpMessageConverter(builder.build());
}
But in this context what would the corresponding value for LOCAL_DATETIME_SERIALIZER
value be for GeolatteGeomModule?
Another message I was getting earlier:
UnsatisfiedDependencyException: Error creating bean with name 'org.geolatte.geom.json.GeometrySerializer': Unsatisfied dependency expressed through constructor parameter 0: No qualifying bean of type 'org.geolatte.geom.json.Settings' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
How do I instantiate settings so I can pass it in as a constructor parameter?
I know this may be read as being a Spring Boot issue, but I am not sure as I have read many documents on how to load a Jackson module into Spring Boot and none of them so far seem to work. All my error messages reference Geolatte in the stack trace, so I wonder if the issue lies there.
Here is my configuration: ENTITY
Register the Bean for GeolatteGeomModule: Note this does get loaded as verified by breatpoints inside GeolatteGeomModule.
Stacktrace:
Now if I change the entity to:
And the controller to load the GeolatteGeomModule manually I get: