aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-21 21:47:45 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-21 21:47:45 -0700
commitabb26e80a5617424d960a0f7d0b98fcb379a5224 (patch)
treea21f23375279d9ae84a18dc7d6a2991feca2ef64 /src/main/java/org/traccar/MainModule.java
parent13b065fc4e8e1a4dc1f35312869151418fc660bd (diff)
downloadtrackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.tar.gz
trackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.tar.bz2
trackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.zip
Fix forwarding date format
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index e0617a734..94669915b 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -62,6 +62,7 @@ import org.traccar.geolocation.UnwiredGeolocationProvider;
import org.traccar.handler.GeocoderHandler;
import org.traccar.handler.GeolocationHandler;
import org.traccar.handler.SpeedLimitHandler;
+import org.traccar.helper.ObjectMapperContextResolver;
import org.traccar.helper.SanitizerModule;
import org.traccar.mail.LogMailManager;
import org.traccar.mail.MailManager;
@@ -81,7 +82,6 @@ import javax.annotation.Nullable;
import javax.inject.Singleton;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.ext.ContextResolver;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
@@ -110,14 +110,13 @@ public class MainModule extends AbstractModule {
objectMapper.registerModule(new SanitizerModule());
}
objectMapper.registerModule(new JSR353Module());
- objectMapper.setConfig(objectMapper
- .getSerializationConfig().without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
+ objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
return objectMapper;
}
@Provides
- public static Client provideClient(ObjectMapper objectMapper) {
- return ClientBuilder.newClient().register((ContextResolver<ObjectMapper>) clazz -> objectMapper);
+ public static Client provideClient(ObjectMapperContextResolver objectMapperContextResolver) {
+ return ClientBuilder.newClient().register(objectMapperContextResolver);
}
@Singleton