quarkusio/quarkus · error · IllegalStateException
Function '${functionName}' has ${paramType} type 'Byte[]' (b
Error message
Function '${functionName}' has ${paramType} type 'Byte[]' (boxed byte array). Use 'byte[]' (primitive byte array) instead. Byte[] is not supported for binary data handling in Funqy Knative Events. What it means
Funqy Knative Events validates function parameter and return types when binding recorders initialize. A Byte[] (boxed byte array) parameter or return type is rejected because binary CloudEvent data is handled with primitive byte[]; the boxed variant is not supported. The check throws IllegalStateException during startup.
Source
Thrown at extensions/funqy/funqy-knative-events/runtime/src/main/java/io/quarkus/funqy/runtime/bindings/knative/events/KnativeEventsBindingRecorder.java:295
// empty set is sub-set of any set
if (first.size() <= 0 || second.size() <= 0) {
log.warn("Invoker " + name + " has multiple matching filters " + one + " " + two);
return true;
}
boolean result = first.size() <= second.size() ? second.containsAll(first) : first.containsAll(second);
if (result) {
log.warn("Invoker " + name + " has multiple matching filters " + one + " " + two);
}
return result;
}
private void validateNotBoxedByteArray(Type type, String functionName, String paramType) {
Class<?> rawType = Reflections.getRawType(type);
if (rawType != null && rawType.isArray()) {
Class<?> componentType = rawType.getComponentType();
if (Byte.class.equals(componentType)) {
throw new IllegalStateException(
"Function '" + functionName + "' has " + paramType + " type 'Byte[]' (boxed byte array). " +
"Use 'byte[]' (primitive byte array) instead. " +
"Byte[] is not supported for binary data handling in Funqy Knative Events.");
}
}
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Change the parameter/return type from Byte[] to the primitive byte[]
- If individual Byte values are needed elsewhere, convert inside the function body (ArrayUtils.toPrimitive / manual copy)
- Rebuild and restart; validation runs at startup so the fix is verified immediately
Example fix
// before
@Funq public void process(byte[] ignored, Byte[] data) { ... }
// after
@Funq public void process(byte[] ignored, byte[] data) { ... } Defensive patterns
Strategy: validation
Validate before calling
// Guard before declaring/using a Funqy knative-events function
static void ensureNotBoxedByteArray(Type type, String name) {
Class<?> raw = Reflections.getRawType(type);
if (raw != null && raw.isArray() && Byte.class.equals(raw.getComponentType()))
throw new IllegalStateException(name + " must use byte[] not Byte[]");
} Type guard
static boolean isPrimitiveByteArray(Type t) {
Class<?> raw = Reflections.getRawType(t);
return raw != null && raw.isArray() && raw.getComponentType() == byte.class;
} Try / catch
try {
invoker.validateTypes();
} catch (IllegalStateException e) {
if (e.getMessage().contains("Byte[]")) {
log.error("Replace Byte[] with byte[] in Funqy function signature");
}
throw e;
} Prevention
- Always use byte[] for binary data in Funqy functions
- Enable IDE inspection for boxed array types (IntelliJ 'Array objects in calls to varargs' style inspections)
- Add an ArchUnit or annotation-processor test rejecting Byte[] in @Funq signatures
- Read the Funqy knative-events docs on binary CloudEvent payloads before designing signatures
When it happens
Trigger: Declaring a @Funq function whose parameter or return type is java.lang.Byte[] (e.g. void f(Byte[] data) or Byte[] f(String in)) in a project using quarkus-funqy-knative-events.
Common situations: Converting code from other frameworks where Byte[] was the convention; IDE auto-boxing when generating array types; developers confusing Byte[] with byte[] for binary payload handling.
Related errors
- knative-events.function-mapping does not map to a function:
- Only supported major versions are 0 and 1.
- Don't know how to get event data (dataContentType: '%s', jav
- Cannot deserialize data for data-content-encoding: '${dataCo
- Don't know how to get event data (dataContentType: '%s', jav
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/c11a942e650be337.
Report an issue: GitHub.