apache/beam · error · UnsupportedOperationException
OutputReceiver unsupported in
Error message
OutputReceiver unsupported in %s
What it means
outputReceiver() is unsupported in this invoker implementation: the base class throws UnsupportedOperationException because no OutputReceiver factory was supplied. The invoker cannot route the DoFn's main outputs without a receiver. The error context in the message identifies which invoker was used.
Solutions
- Supply an outputReceiverFactory when creating the invoker
- Use the runner's normal invocation path (DoFnProcessContext) instead of invoking via the raw invoker
- In tests, use DoFnTester which wires receivers, or register a test OutputReceiver
- Capture main-bundle output via a ProcessContext implementation rather than the base invoker
Example fix
// before
DoFnInvoker invoker = DoFnInvokers.newInvoker(doFn);
invoker.invokeProcessElement(context); // context.output() throws
// after
DoFnInvoker invoker = DoFnInvokers.newInvoker(doFn,
DoFnInvoker.OutputProvider.boundTo((OutputReceiver<Object>) receiver)); Defensive patterns
Strategy: try-catch
Validate before calling
boolean hasOutput = invoker instanceof /* concrete invoker with output support */ ;
Type guard
null
Try / catch
try { invoker.outputReceiver(doFn).output(v); } catch (UnsupportedOperationException e) { throw new IllegalStateException("Invoker lacks output receiver", e); } Prevention
- Always bind an OutputReceiver factory when creating invokers manually
- Prefer DoFnTester or the runner path in tests
- Don't call invokeProcessElement with a context lacking receivers
When it happens
Trigger: Invoking outputReceiver(DoFn) on a DelegatingDoFnInvoker or generated invoker built without an outputReceiverFactory; DoFn code calling c.output(...) when the invoker lacks a bound receiver.
Common situations: Custom invocation code (e.g. testing frameworks, state/timer utilities) that invokes the DoFn directly without wiring output receivers; using DoFnInvokers.newInvoker with a restricted factory set.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- BoundedWindow unsupported in
- Cannot access fire timestamp outside of @OnTimer method.
- Cannot access OnTimerContext outside of @OnTimer methods.
- Cannot access OnWindowExpirationContext outside of…
- Cannot access time domain outside of @ProcessTimer method.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/fa68df5cf717c751.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/DoFnInvoker.java:396
throw new UnsupportedOperationException(
String.format("TimerId unsupported in %s", getErrorContext()));
}
@Override
public TimeDomain timeDomain(DoFn<InputT, OutputT> doFn) {
throw new UnsupportedOperationException(
String.format("TimeDomain unsupported in %s", getErrorContext()));
}
@Override
public OutputReceiver<OutputT> outputReceiver(DoFn<InputT, OutputT> doFn) {
throw new UnsupportedOperationException(
String.format("OutputReceiver unsupported in %s", getErrorContext()));
}
@Override
public OutputReceiver<Row> outputRowReceiver(DoFn<InputT, OutputT> doFn) {
throw new UnsupportedOperationException(
String.format("Row OutputReceiver unsupported in %s", getErrorContext()));
}
@Override
public MultiOutputReceiver taggedOutputReceiver(DoFn<InputT, OutputT> doFn) {
throw new UnsupportedOperationException(
String.format("MultiOutputReceiver unsupported in %s", getErrorContext()));
}
@Override
public Object restriction() {
throw new UnsupportedOperationException(
String.format("Restriction unsupported in %s", getErrorContext()));
}
@Override
public BoundedWindow window() {
throw new UnsupportedOperationException(View on GitHub (pinned to 12126d8942)