{"record":{"id":"86663d0464f6315b","repo":"quarkusio/quarkus","slug":"don-t-know-how-to-get-event-data-datacontenttype-86663d","errorCode":null,"errorMessage":"Don't know how to get event data (dataContentType: '%s', javaType: '%s').","messagePattern":"Don't know how to get event data \\(dataContentType: '(.+?)', javaType: '(.+?)'\\)\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"extensions/funqy/funqy-knative-events/runtime/src/main/java/io/quarkus/funqy/runtime/bindings/knative/events/JsonCloudEventImpl.java","lineNumber":229,"sourceCode":"                    if (event.has(\"data\")) {\n                        data = (T) mapper.writeValueAsBytes(event.get(\"data\"));\n                        return data;\n                    } else if (event.has(\"data_base64\")) {\n                        String txt = event.get(\"data_base64\").asText();\n                        data = (T) Base64.getDecoder().decode(txt);\n                        return data;\n                    } else {\n                        return null;\n                    }\n                }\n\n            } catch (JacksonException e) {\n                throw new RuntimeException(e);\n            }\n        } else {\n            String msg = String.format(\"Don't know how to get event data (dataContentType: '%s', javaType: '%s').\",\n                    dataContentType(), dataType.getTypeName());\n            throw new RuntimeException(msg);\n        }\n    }\n\n}\n","sourceCodeStart":211,"sourceCodeEnd":234,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/funqy/funqy-knative-events/runtime/src/main/java/io/quarkus/funqy/runtime/bindings/knative/events/JsonCloudEventImpl.java#L211-L234","documentation":"Same family as error 793 but in JsonCloudEventImpl: after trying JSON deserialization paths, if the requested dataType cannot be produced from the event JSON (unsupported combination of dataContentType and Java type), it throws this RuntimeException.","triggerScenarios":"Calling data(SomeUnsupportedType.class) on a JsonCloudEventImpl where the content type is not JSON-mappable to the target type (e.g. text/plain content with a POJO target, or a complex type with no Jackson mapping).","commonSituations":"Function signature declares a POJO but the event's ce-datacontenttype is text/plain or absent; target type lacks a default constructor/Jackson mapping; binary content requested as a structured type.","solutions":["Declare the function input as String or byte[] and deserialize manually.","Set the event's Content-Type to application/json so Jackson can map it to the POJO.","Add a Jackson @JsonDeserialize mapping/default constructor to the target type.","Align the function's input type with the actual event payload type."],"exampleFix":"// before\nMyPojo p = event.data(MyPojo.class); // content-type: text/plain\n// after\nbyte[] raw = event.data(byte[].class);\nMyPojo p = MAPPER.readValue(raw, MyPojo.class);","handlingStrategy":"validation","validationCode":"if (!\"application/json\".equals(event.dataContentType()) && !isSimpleType(dataType)) {\n    throw new IllegalArgumentException(\"JSON event data requires application/json or String/byte[] target\");\n}","typeGuard":"boolean jsonDataTypeSupported(String contentType, Class<?> t) {\n    return \"application/json\".equals(contentType) || t == String.class || t == byte[].class;\n}","tryCatchPattern":"try { return event.data(dataType); } catch (RuntimeException e) { if (e.getMessage().startsWith(\"Don't know how to get event data\")) { byte[] raw = event.data(byte[].class); return MAPPER.readValue(raw, dataType); } throw e; }","preventionTips":["Match the function input type to the event's ce-datacontenttype","Use application/json for structured POJO payloads","Give POJOs default constructors and Jackson annotations","Fall back to byte[] + manual deserialization for exotic content types"],"tags":["knative","cloudevent","json","deserialization","funqy"],"backgroundTag":"unsupported-event-data-type","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}