{"record":{"id":"e0c824abc8f0389c","repo":"oracle/graal","slug":"continuations-must-be-run-on-the-java-on-truffle-j","errorCode":null,"errorMessage":"Continuations must be run on the Java on Truffle JVM with the java.Continuum option set to true.","messagePattern":"Continuations must be run on the Java on Truffle JVM with the java\\.Continuum option set to true\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"espresso/src/org.graalvm.continuations/src/org/graalvm/continuations/ContinuationImpl.java","lineNumber":351,"sourceCode":"     * Runs the continuation until it either completes or calls {@link SuspendCapability#suspend()}.\n     * The difference between the two reasons for returning is visible in {@link #getState()}. A\n     * continuation may not be resumed if it's already {@link State#COMPLETED} or\n     * {@link State#FAILED}, nor if it is already {@link State#RUNNING}.\n     *\n     * <p>\n     * If an exception is thrown by the continuation and escapes the entry point, it will be wrapped\n     * in {@link ContinuationExecutionException}, then rethrown here. The continuation is then no\n     * longer usable and must be discarded.\n     *\n     * @throws IllegalContinuationStateException if the {@link #getState()} is not\n     *             {@link State#SUSPENDED}.\n     * @throws IllegalMaterializedRecordException if the VM rejects the frames recorded in\n     *             {@link #stackFrameHead}.\n     */\n    @Override\n    public boolean resume() {\n        if (!isSupported()) {\n            throw new UnsupportedOperationException(\"Continuations must be run on the Java on Truffle JVM with the java.Continuum option set to true.\");\n        }\n\n        // Are we in the special waiting-to-start state?\n        if (updateState(State.NEW, State.RUNNING)) {\n            // Enable the use of suspend capabilities.\n            setExclusiveOwner();\n            try {\n                return start0();\n            } finally {\n                clearExclusiveOwner();\n            }\n        } else if (updateState(State.SUSPENDED, State.RUNNING)) {\n            setExclusiveOwner();\n            try {\n                // We are ready to resume, make sure the VM has the most up-to-date frames\n                ensureDematerialized();\n                assert stackFrameHead == null;\n                return resume0();","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/org.graalvm.continuations/src/org/graalvm/continuations/ContinuationImpl.java#L333-L369","documentation":"UnsupportedOperationException from ContinuationImpl.resume() when the VM lacks continuation support. Same precondition as Continuation.create but raised on the resume path of an already-obtained Continuation instance (e.g. one deserialized on, or transferred to, an unsupported JVM).","triggerScenarios":"Calling resume() on a Continuation object while running on a non-Truffle JVM or a Truffle JVM without java.Continuum enabled; deserializing a continuation on a plain JVM and then resuming it.","commonSituations":"Serialized continuations moved between nodes where only some run Java on Truffle; mixed test environments where creation succeeded but resume happens in a different JVM configuration.","solutions":["Check Continuation.isSupported() before calling resume(), not only before create().","Ensure every JVM that touches continuations runs Java on Truffle with java.Continuum=true.","Route continuation work to dedicated Truffle worker nodes if the fleet is heterogeneous.","Fail fast at node startup if continuation support is required."],"exampleFix":"// before\ncontinuation.resume();\n\n// after\nif (!Continuation.isSupported()) {\n    throw new UnsupportedOperationException(\"This node cannot resume continuations; route to a Java-on-Truffle worker\");\n}\ncontinuation.resume();","handlingStrategy":"validation","validationCode":"if (!Continuation.isSupported()) {\n    throw new UnsupportedOperationException(\"cannot resume continuations on this JVM\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check isSupported() before every resume site, not only creation.","Verify VM configuration on all nodes that touch continuations.","Route continuation work to Truffle-configured workers in mixed fleets."],"tags":["continuations","unsupported-operation","graalvm","truffle","espresso","vm-config"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}