{"record":{"id":"e321a8f738f11b9a","repo":"apache/beam","slug":"failed-to-locate-processcontinuation-stop","errorCode":null,"errorMessage":"Failed to locate ProcessContinuation.stop()","messagePattern":"Failed to locate ProcessContinuation\\.stop\\(\\)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java","lineNumber":1372,"sourceCode":"                TypeCasting.to(new TypeDescription.ForLoadedType(p.keyT().getRawType())));\n          }\n        });\n  }\n\n  /**\n   * Implements the invoker's {@link DoFnInvoker#invokeProcessElement} method by delegating to the\n   * {@link ProcessElement} method.\n   */\n  private static final class ProcessElementDelegation\n      extends DoFnMethodWithExtraParametersDelegation {\n    private static final MethodDescription PROCESS_CONTINUATION_STOP_METHOD;\n\n    static {\n      try {\n        PROCESS_CONTINUATION_STOP_METHOD =\n            new MethodDescription.ForLoadedMethod(DoFn.ProcessContinuation.class.getMethod(\"stop\"));\n      } catch (NoSuchMethodException e) {\n        throw new RuntimeException(\"Failed to locate ProcessContinuation.stop()\");\n      }\n    }\n\n    /** Implementation of {@link MethodDelegation} for the {@link ProcessElement} method. */\n    private ProcessElementDelegation(\n        TypeDescription doFnType, DoFnSignature.ProcessElementMethod signature) {\n      super(doFnType, signature);\n    }\n\n    @Override\n    protected StackManipulation afterDelegation(MethodDescription instrumentedMethod) {\n      if (TypeDescription.VOID.equals(targetMethod.getReturnType().asErasure())) {\n        return new StackManipulation.Compound(\n            MethodInvocation.invoke(PROCESS_CONTINUATION_STOP_METHOD), MethodReturn.REFERENCE);\n      } else {\n        return MethodReturn.of(targetMethod.getReturnType().asErasure());\n      }\n    }","sourceCodeStart":1354,"sourceCodeEnd":1390,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/reflect/ByteBuddyDoFnInvokerFactory.java#L1354-L1390","documentation":"A static initializer caches a MethodDescription for DoFn.ProcessContinuation.stop(), which exists in every valid Beam SDK version. If reflection cannot find stop(), the class throws this RuntimeException, indicating a corrupt or foreign ProcessContinuation class is on the classpath.","triggerScenarios":"Class initialization runs ProcessContinuation.class.getMethod(\"stop\") and receives NoSuchMethodException — only possible if the loaded ProcessContinuation class lacks that method.","commonSituations":"Shaded/relocated Beam classes mixed with an incompatible SDK version; a stubbed ProcessContinuation shadowing the real one; broken partial upgrade of beam-sdks-java-core.","solutions":["Ensure the real org.apache.beam.sdk.transforms.DoFn$ProcessContinuation from a consistent SDK version is loaded; remove shadowing jars.","Rebuild dependencies so all Beam artifacts share one version.","Locate the loaded class with -verbose:class (or getCodeSource()) and delete the bad copy."],"exampleFix":"// before\n// fat jar contains old beam-core whose ProcessContinuation lacks stop()\n// after\nmvn dependency:tree -Dincludes=org.apache.beam # pin all beam artifacts to one version and exclude stale copies","handlingStrategy":"validation","validationCode":"try {\n  DoFn.ProcessContinuation.class.getMethod(\"stop\");\n} catch (NoSuchMethodException e) {\n  throw new IllegalStateException(\"Incompatible org.apache.beam DoFn class on classpath\", e);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check where DoFn/ProcessContinuation loads from with -verbose:class; remove shadowing jars.","Keep all Beam modules on a single release version.","Avoid hand-written or stubbed copies of Beam SDK classes in your source tree."],"tags":["java","apache-beam","bytebuddy","classpath","reflection"],"backgroundTag":"class-not-found","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"}