Ich nehme etwas älteren Code und versuche, ein Lambda zu schreiben, um an einer Funktion zu arbeiten.AWS Lambda-Serialisierungsobjekt in einem anderen Modul
Die Funktion sieht wie
public Task doTask(Message message) throws Exception {
LOG.debug("debug message");
// ... more code
}
jedoch der Parameter Message
definiert (mit Getter und Setter) in einem anderen Modul (und übergeben als Abhängigkeit). Als Ergebnis erhalte ich die Fehlermeldung:
{
"errorMessage": "An error occurred during JSON parsing",
"errorType": "java.lang.RuntimeException",
"stackTrace": [],
"cause": {
"errorMessage": "com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.mywebsite.messaging.Message, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information\n at [Source: [email protected]; line: 1, column: 1]",
"errorType": "java.io.UncheckedIOException",
"stackTrace": [],
"cause": {
"errorMessage": "Can not construct instance of com.mywebsite.messaging.Message, problem: abstract types either need to be mapped to concrete types, have custom deserializer, or be instantiated with additional type information\n at [Source: [email protected]; line: 1, column: 1]",
"errorType": "com.fasterxml.jackson.databind.JsonMappingException",
"stackTrace": [
"com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)",
"com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:892)",
"com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:139)",
"com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1511)",
"com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1102)"
]
}
}
}
Wie ist es möglich, dieses Objekt zu serialisieren, die nicht einmal in meinem Modul ist?
Jede und alle Hilfe würde sehr geschätzt werden.
Danke!