You can try creating a custom deserializer.

@JsonDeserialize(using = CaseInsensitiveLocalTimeDeserializer.class)
@JsonProperty(value = "starttime")
private LocalTime startTime;

@JsonDeserialize(using = CaseInsensitiveLocalTimeDeserializer.class)
@JsonProperty(value = "endtime")
private LocalTime endTime;

with :

public class CaseInsensitiveLocalTimeDeserializer extends JsonDeserializer<LocalTime> {

    private final DateTimeFormatter formatter;

    public CaseInsensitiveLocalTimeDeserializer() {
        this.formatter = DateTimeFormatter.ofPattern("h:mma").withLocale(Locale.ENGLISH);
    }

    @Override
    public LocalTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
        String timeStr = p.getText().toUpperCase();  // Convert to upper case to handle AM/PM consistently
        try {
            return LocalTime.parse(timeStr, formatter);
        } catch (DateTimeParseException e) {
            throw new InvalidFormatException(p, "Failed to parse time", timeStr, LocalTime.class);
        }
    }
}

And the mapper would look like this when adding the deserializer.

public static ObjectMapper getObjectMapper() {
    ObjectMapper objectMapper = new ObjectMapper();
    JavaTimeModule javaTimeModule = new JavaTimeModule();
    javaTimeModule.addDeserializer(LocalTime.class, new CaseInsensitiveLocalTimeDeserializer());
    objectMapper.registerModule(javaTimeModule);
    // Other configurations...
    return objectMapper;
}
Answer from драган-јованковић on Stack Overflow
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 4577
Cannot deserialize value of type `java.math.BigDecimal` from String "3." (not a valid representation) · Issue #4577 · FasterXML/jackson-databind
June 12, 2024 - com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.math.BigDecimal` from String "5.": not a valid representation at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 10] (through reference chain: TestDTO["value"]) at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1958) at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(Deser
Author: FasterXML
🌐
GitHub
github.com › FasterXML › jackson-modules-java8 › issues › 256
Cannot deserialize value of type `java.time.LocalDate` from String "07-OCT-21": Failed to deserialize java.time.LocalDate: · Issue #256 · FasterXML/jackson-modules-java8
December 4, 2022 - Exception in thread "main" com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.time.LocalDate` from String "07-OCT-21": Failed to deserialize java.time.LocalDate: (java.time.format.DateTimeParseException) Text '07-OCT-21' could not be parsed at index 0 at [Source: (String)"{"name":"party","eventDate":"07-OCT-21"}"; line: 1, column: 29] (through reference chain: jolt.custom.date.transformer.model.Event["eventDate"]) at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) at com.fasterxml.jackson.databind.Des
Author: FasterXML
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 2823
Cannot deserialize enum field · Issue #2823 · FasterXML/jackson-databind
August 19, 2020 - com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.bakdata.conquery.integration.json.AnEnum` from String "field": field was not one of [AnEntry] at [Source: (String)"{ "field" : "AnEntry" }"; line: 1, column: 3] at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1702) at io.dropwizard.jackson.FuzzyEnumModule$PermissiveEnumDeserializer.deserialize(FuzzyEnumModule.java:59) at io.dropwizard.jackson.Fu
Author: FasterXML
🌐
Stack Overflow
stackoverflow.com › questions › 71769043 › com-fasterxml-jackson-databind-exc-invalidformatexception-cannot-deserialize-va
spring boot - com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type from String: not one of the values accepted for Enum class - Stack Overflow
April 6, 2022 - com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `models.SeasonType` from String "Season": not one of the values accepted for Enum class: [NO_SEASON, UNKNOWN, SEASON]
🌐
Stack Overflow
stackoverflow.com › questions › 76403515 › com-fasterxml-jackson-databind-exc-mismatchedinputexception-cannot-deserialize
java - com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `[]` from Object value (token `JsonToken.START_OBJECT`) - Stack Overflow
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `[Lcom.forecast.model.Forecast;` from Object value (token `JsonToken.START_OBJECT`) at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 1] at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[jackson-databind-2.15.0.jar:2.15.0] at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1752) ~[jackson-databind-2.15.0.jar:2.15.0] at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1526) ~[jackson-databind-2.15.0.jar:2.15.0] at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1473) ~[jackson-databind-2.15.0.jar:2.15.0]
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 3056
MismatchedInputException: Cannot deserialize instance of `com.fasterxml.jackson.databind.node.ObjectNode` out of VALUE_NULL token · Issue #3056 · FasterXML/jackson-databind
February 14, 2021 - MismatchedInputException: Cannot deserialize instance of com.fasterxml.jackson.databind.node.ObjectNode out of VALUE_NULL token#3056 ... When using readerForUpdating and updating an existing objectNode to a null Node this exception is triggered
Author: FasterXML
Find elsewhere
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 1850
`@JsonValue` with integer for enum does not deserialize correctly · Issue #1850 · FasterXML/jackson-databind
December 5, 2017 - com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `com.example.Type` from number 3: index value outside legal index range [0..1] at [Source: (InputStreamReader); line: 1, column: 60] (through reference chain: java.util.ArrayList[0]->com.example.Pojo["type"]) at com.fasterxml.jackson.databind.DeserializationContext.weirdNumberException(DeserializationContext.java:1563) at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdNumberValue(DeserializationContext.java:953) at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:200) at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:149) If I add a @JsonCreator to a static method that matches the value to the internal field, the enum can be deserialized correctly.
Author: FasterXML
🌐
Baeldung
baeldung.com › home › json › jackson › jackson exceptions – problems and solutions
Jackson Exceptions - Problems and Solutions | Baeldung
April 8, 2024 - The stack trace of the exception says it all: “Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)“. It means that Jackson fails to deserialize an object into a String instance.
🌐
Medium
devmykael.medium.com › how-to-properly-deserialize-an-instance-out-of-value-number-float-using-jackson-databind-in-java-af58e86d7b9d
How to properly deserialize an instance out of VALUE_NUMBER_FLOAT using Jackson Databind in Java | by Maycon T. de Almeida | Medium
June 20, 2023 - This is an issue on GitHub in the Jackson API, and it seems to work on version 2.13 and later ones, although I didn’t test it. Issue: https://github.com/FasterXML/jackson-databind/issues/1850
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › core java › json › jackson
Jackson Exceptions - Examples Java Code Geeks - 2026
June 21, 2020 - The deserialization after applying the fix will be successful without any exception at runtime. Consider the following model class Customer with two fields id and name. ... The below code attempts to deserialize an array of JSON objects of type Customer to an instance of the Customer class.
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 2754
Deserializing enum error by using int/Integer value with @JsonValue · Issue #2754 · FasterXML/jackson-databind
June 9, 2020 - RED com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `cn.zzzzbw.springboot.Test$ColorEnum` from number 10: index value outside legal index range [0..2] at [Source: (String)"10"; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.weirdNumberException(DeserializationContext.java:1710) at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdNumberValue(DeserializationContext.java:992) at com.fasterxml.jackson.databind.de
Author: FasterXML
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 1320266 › java-cosmosdb-how-to-fix-jackson-mismatchedinputex
Java CosmosDB: How to fix Jackson MismatchedInputException for deserializing value from Object value (token `JsonToken.START_OBJECT`) - Microsoft Q&A
67 more Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `` from Object value (token `JsonToken.START_OBJECT`) at [Source: (byte[])"{"id":""[truncated 681 bytes]; line: 1, column: 1] at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1746) at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1520) at com.fasterxml.jackson.databind.D
🌐
GitHub
github.com › FasterXML › jackson-databind › issues › 5271
`EnumDeserializer` fails to deserialize Enums with `@JsonValue` - uses table with name() key instead of `@JsonValue` key · Issue #5271 · FasterXML/jackson-databind
August 22, 2025 - tools.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `org.springframework.data.couchbase.core.mapping.MappingCouchbaseConverterTests$MyEnum` from String "10%": not one of the values accepted for Enum class: [T30, T20, T10] at [No location information] at tools.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:37) at tools.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1977) at tools.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:1320) at tools.jackson.
Author: FasterXML
🌐
GitHub
github.com › dependency-check › DependencyCheck › issues › 6191
InvalidFormatException: Cannot deserialize value of type `java.util.Date` from String "2023-12-01T15:09:26..642Z" · Issue #6191 · dependency-check/DependencyCheck
December 1, 2023 - null)) at [Source: (InputStreamReader); line: 4, column: 21] (through reference chain: org.owasp.dependencycheck.data.knownexploited.json.KnownExploitedVulnerabilitiesSchema["dateReleased"]) at com.fasterxml.jackson.databind.exc.InvalidFormatException.from (InvalidFormatException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException (DeserializationContext.java:2002) at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue (DeserializationContext.java:1230) at com.fasterxml.jackson.databind.deser.std.StdDeserializer._parseDate (StdDeseria
Author: dependency-check
🌐
GitHub
github.com › zalando › problem-spring-web › issues › 206
Situation where an exception happens while parsing JSON request · Issue #206 · zalando/problem-spring-web
August 21, 2018 - Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `java.lang.Long` from String "test": not a valid Long value at [Source: (PushbackInputStream); line: 2, column: 8] (through reference chain: java.util.ArrayList[0]->test.Dto["id"]) at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1548) at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.jav