Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
199a054
starting updating the pom.xml to move toe jackson3
shroffk Jul 30, 2026
e684c57
updating jackson dependencies
shroffk Jul 30, 2026
c066494
update imports com.fasterxml.jackson to tools.jackson
shroffk Jul 30, 2026
0832f5b
switch to using jackson exception JacksonException
shroffk Jul 30, 2026
202b020
Continue fixing the exception to match jackson3
shroffk Jul 30, 2026
7d07659
fix most of the instances of the ObjectMapper creation
shroffk Jul 30, 2026
4700916
fixing object mappers with added modules and mxin's
shroffk Jul 30, 2026
18495d8
fixing the more complex objectmappers
shroffk Jul 30, 2026
f857621
prepare to move to elastic 9.4.x
shroffk Jul 30, 2026
fe3e187
updating deserializers and queries to match elastic 9.x client
shroffk Jul 30, 2026
d42885e
Continued fixes of the ObjectMapper
shroffk Jul 30, 2026
31e7c7c
use the new JsonFactory
shroffk Jul 30, 2026
b755b9a
fix JsonToken usage to use new API
shroffk Jul 30, 2026
39cce4d
the services need explicit dep definition
shroffk Jul 31, 2026
26cff10
improve the mapper test to be more resilient
shroffk Jul 31, 2026
16aab05
disabling a few tests until we move to springboot4
shroffk Jul 31, 2026
257ac1b
expliclity include jackson dep, update exception types
shroffk Jul 31, 2026
08e5148
replace the legacy elastic rest client with rest5
shroffk Jul 31, 2026
9db701d
expliclity manage dep
shroffk Jul 31, 2026
f08635a
more temporary explicit dep - remove when moving to spring4
shroffk Jul 31, 2026
2fb8c08
expanding the pom to support local IT
shroffk Aug 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions app/alarm/logging-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,23 @@
<version>6.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/tools.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<version>${tools.jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/tools.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<version>${tools.jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.annotations.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package org.phoebus.applications.alarm.logging.ui;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ObjectMapper;
import org.phoebus.framework.jobs.Job;
import org.phoebus.framework.jobs.JobManager;
import org.phoebus.framework.jobs.JobRunnableWithCancel;
import org.phoebus.util.http.QueryParamsHelper;
import tools.jackson.databind.json.JsonMapper;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
Expand Down Expand Up @@ -51,8 +52,9 @@ private AlarmLogConfigSearchJob(HttpClient httpClient,
this.pattern = pattern;
this.alarmMessageHandler = alarmMessageHandler;
this.errorHandler = errorHandler;
this.objectMapper = new ObjectMapper();
this.objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
this.objectMapper = JsonMapper.builder()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.phoebus.applications.alarm.logging.ui;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.annotation.JsonInclude;
import tools.jackson.core.type.TypeReference;
import tools.jackson.databind.DeserializationFeature;
import tools.jackson.databind.ObjectMapper;
import javafx.collections.ObservableMap;
import org.phoebus.applications.alarm.logging.ui.AlarmLogTableQueryUtil.Keys;
import org.phoebus.framework.jobs.Job;
Expand All @@ -11,6 +12,7 @@
import org.phoebus.framework.jobs.JobRunnable;
import org.phoebus.framework.preferences.PreferencesReader;
import org.phoebus.util.http.QueryParamsHelper;
import tools.jackson.databind.json.JsonMapper;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
Expand Down Expand Up @@ -63,8 +65,10 @@ private AlarmLogSearchJob(HttpClient httpClient, Boolean isNodeTable, Observable
this.searchParameters = searchParameters;
this.alarmMessageHandler = alarmMessageHandler;
this.errorHandler = errorHandler;
this.objectMapper = new ObjectMapper();
this.objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
this.objectMapper = JsonMapper.builder()
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
.changeDefaultPropertyInclusion(incl -> incl.withValueInclusion(JsonInclude.Include.NON_NULL))
.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package org.phoebus.applications.alarm.logging.ui;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.JsonNode;
import tools.jackson.databind.ObjectMapper;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
Expand Down Expand Up @@ -550,9 +549,6 @@ public void search() {

private static final ObjectMapper objectMapper = new ObjectMapper();

static {
objectMapper.registerModule(new JavaTimeModule());
}

@FXML
public void createContextMenu() {
Expand Down Expand Up @@ -593,7 +589,7 @@ public void createContextMenu() {
Object jsonObject = objectMapper.readValue(result.getConfig_msg(), Object.class);
sb.append("config_msg: ").append(objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonObject)).append(newLine);
alarmInfo.setContentText(sb.toString());
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
alarmInfo.setContentText(Messages.ConfigurationInfoNotFound);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import tools.jackson.core.JsonParser;
import tools.jackson.core.JacksonException;
import tools.jackson.databind.DeserializationContext;
import tools.jackson.databind.deser.std.StdDeserializer;
import tools.jackson.databind.annotation.JsonDeserialize;

import java.io.IOException;
import java.time.Instant;

@JsonInclude(Include.NON_NULL)
Expand Down Expand Up @@ -152,13 +151,14 @@ public void setEnabled(boolean enabled) {
this.enabled = enabled;
}

public static class AlarmInstantDeserializer extends JsonDeserializer<Instant> {
public static class AlarmInstantDeserializer extends StdDeserializer<Instant> {

public AlarmInstantDeserializer() {
super(Instant.class);
}

@Override
public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws JacksonException {
return Instant.parse(p.getText());
}
}
Expand Down
17 changes: 7 additions & 10 deletions app/alarm/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/tools.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${tools.jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/tools.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<version>${tools.jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;

/**
*
Expand Down Expand Up @@ -108,7 +108,7 @@ public Map<String, String> sourceMap() {
public String toString() {
try {
return objectMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm command message ", e);
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;

/**
*
Expand Down Expand Up @@ -225,7 +225,7 @@ public boolean isLeaf() {
public String toString() {
try {
return AlarmMessageUtil.objectConfigMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm config message ", e);
}
return "";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.phoebus.applications.alarm.messages;

import tools.jackson.core.JacksonException;

import static org.phoebus.applications.alarm.AlarmSystem.logger;
import static org.phoebus.applications.alarm.messages.AlarmMessageUtil.objectMapper;

import java.util.logging.Level;

import com.fasterxml.jackson.core.JsonProcessingException;

/** Alarm detail */
public class AlarmDetail {

Expand Down Expand Up @@ -62,7 +62,7 @@ public void setDelay(int delay) {
public String toString() {
try {
return objectMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm detail message ", e);
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;

/**
* A message which describes both state and configuration events
Expand Down Expand Up @@ -417,9 +417,9 @@ public void setDelete(String delete) {
/**
* @return json string representation of this object
*
* @throws JsonProcessingException on error
* @throws JacksonException on error
*/
public String toJson() throws JsonProcessingException {
public String toJson() throws JacksonException {
if (isConfig()) {
return objectConfigMapper.writeValueAsString(this);
} else if (isState()){
Expand All @@ -433,7 +433,7 @@ public String toJson() throws JsonProcessingException {
public String toString() {
try {
return toJson();
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm message ", e);
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import tools.jackson.databind.ObjectMapper;
import tools.jackson.databind.json.JsonMapper;
import tools.jackson.databind.module.SimpleModule;
import org.phoebus.applications.alarm.model.EnabledState;

import java.io.Serializable;
Expand All @@ -23,31 +23,28 @@
public class AlarmMessageUtil implements Serializable{

// Object mapper for the alarm state messages
@JsonIgnore
static final ObjectMapper objectStateMapper = new ObjectMapper();
static {
objectStateMapper.registerModule(new JavaTimeModule());
objectStateMapper.addMixIn(AlarmMessageUtil.class, AlarmStateJsonMessage.class);
}
@JsonIgnore
static final ObjectMapper objectStateMapper = JsonMapper.builder()
.addMixIn(AlarmMessageUtil.class, AlarmStateJsonMessage.class)
.build();

// Object mapper for the alarm config messages
@JsonIgnore
static final ObjectMapper objectConfigMapper = new ObjectMapper();
static {
SimpleModule simple_module = new SimpleModule();
simple_module.addSerializer(new EnabledSerializer());
static final ObjectMapper objectConfigMapper = createConfigMapper();

objectConfigMapper.registerModule(new JavaTimeModule());
objectConfigMapper.registerModule(simple_module);
objectConfigMapper.addMixIn(AlarmMessageUtil.class, AlarmConfigJsonMessage.class);
private static ObjectMapper createConfigMapper() {
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(new EnabledSerializer());

return JsonMapper.builder()
.addModule(simpleModule)
.addMixIn(AlarmMessageUtil.class, AlarmConfigJsonMessage.class)
.build();
}

// Object mapper for all other alarm messages
@JsonIgnore
static final ObjectMapper objectMapper = new ObjectMapper();
static {
objectMapper.registerModule(new JavaTimeModule());
}

private static class AlarmStateJsonMessage {
@JsonIgnore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;

/**
* A bean representing a alarm state message
Expand Down Expand Up @@ -206,7 +206,7 @@ public Map<String, String> sourceMap() {
public String toString() {
try {
return AlarmMessageUtil.objectStateMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm state message ", e);
}
return "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import tools.jackson.core.JacksonException;

/** Talk message */
@JsonInclude(Include.NON_NULL)
Expand Down Expand Up @@ -56,7 +56,7 @@ public void setTalk(String talk) {
public String toString() {
try {
return objectMapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
} catch (JacksonException e) {
logger.log(Level.WARNING, "failed to parse the alarm talk message ", e);
}
return "";
Expand Down
Loading
Loading