{"record":{"id":"5ca0fbe33d6628d3","repo":"apache/beam","slug":"solaceio-write-unboundedsolacewriter-context-no-context","errorCode":null,"errorMessage":"SolaceIO.Write.UnboundedSolaceWriter.Context: No context provided","messagePattern":"SolaceIO\\.Write\\.UnboundedSolaceWriter\\.Context: No context provided","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/write/UnboundedSolaceWriter.java","lineNumber":368,"sourceCode":"        T output,\n        @Nullable Instant timestamp, // Not required for windowed context\n        @Nullable BoundedWindow window) { // Not required for windowed context\n      if (windowedContext != null) {\n        windowedContext.output(tag, output);\n      } else if (finishBundleContext != null) {\n        if (timestamp == null) {\n          throw new IllegalStateException(\n              \"SolaceIO.Write.UnboundedSolaceWriter.Context: Timestamp is required for a\"\n                  + \" FinishBundleContext.\");\n        }\n        if (window == null) {\n          throw new IllegalStateException(\n              \"SolaceIO.Write.UnboundedSolaceWriter.Context: BoundedWindow is required for a\"\n                  + \" FinishBundleContext.\");\n        }\n        finishBundleContext.output(tag, output, timestamp, window);\n      } else {\n        throw new IllegalStateException(\n            \"SolaceIO.Write.UnboundedSolaceWriter.Context: No context provided\");\n      }\n    }\n  }\n}\n","sourceCodeStart":350,"sourceCodeEnd":374,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/write/UnboundedSolaceWriter.java#L350-L374","documentation":"UnboundedSolaceWriter requires an active pipeline context (either a ProcessContext for streaming output or a FinishBundleContext with a BoundedWindow) to emit elements downstream. When neither is set on the writer's Context object, output() cannot route the message and throws this IllegalStateException. It signals an internal lifecycle/configuration error rather than a user data problem.","triggerScenarios":"The writer's Context was constructed without calling either withProcessContext or withFinishBundleContext (with a BoundedWindow) before publishResults invokes output(); typically a mis-wired custom writer setup or a Beam runner lifecycle change that skips bundle finalization context injection.","commonSituations":"Custom or forked Beam runners that do not supply a FinishBundleContext; unit tests instantiating UnboundedSolaceWriter directly without populating its Context; regressions after Beam core changes to DoFn lifecycle context propagation.","solutions":["Ensure the writer Context is populated with a ProcessContext (streaming path) or a FinishBundleContext plus BoundedWindow (batch/finish-bundle path) before calling output()","Upgrade the SolaceIO connector and Beam SDK to matching supported versions so lifecycle contexts are injected correctly","If running on a custom runner, verify it invokes FinishBundle with a BoundedWindow as SolaceIO expects","In tests, use Beam's TestPipeline / DoFnTester so contexts are provided rather than constructing the writer manually"],"exampleFix":"// before\nUnboundedSolaceWriter.Context ctx = new UnboundedSolaceWriter.Context();\nwriter.publishResults(element, ctx); // no context set -> IllegalStateException\n// after\nUnboundedSolaceWriter.Context ctx = new UnboundedSolaceWriter.Context()\n    .withFinishBundleContext(finishBundleContext, outputTag, boundedWindow);\nwriter.publishResults(element, ctx);","handlingStrategy":"validation","validationCode":"if (ctx.getProcessContext() == null && ctx.getFinishBundleContext() == null) {\n  throw new IllegalStateException(\"Solace writer context not initialized before output\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always construct the writer Context via withProcessContext or withFinishBundleContext before emitting","Use Beam's TestPipeline/DoFnTester in tests instead of hand-built contexts","Keep SolaceIO and Beam SDK versions aligned","Review runner lifecycle support for FinishBundleContext/BoundedWindow"],"tags":["java","beam","solace","lifecycle","illegal-state"],"backgroundTag":"missing-required-config-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}