{"record":{"id":"1d477d5a7895eefe","repo":"oracle/graal","slug":"no-instance-of-polyglot-can-be-created","errorCode":null,"errorMessage":"No instance of Polyglot can be created","messagePattern":"No instance of Polyglot can be created","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java","lineNumber":68,"sourceCode":" * Foreign values, obtained from {@link Polyglot#eval} or {@link Polyglot#importObject}, are\n * returned as {@link Object}. There are two options to make their members accessible from Espresso:\n * <ul>\n * <li>{@link Polyglot#cast Polyglot.cast} the object to a Java interface. In this case, method\n * calls to the interface methods will be forwarded to the foreign object.\n * <li>{@link Polyglot#cast Polyglot.cast} the object to a Java class. In this case, accesses to the\n * class fields will be forwarded to the foreign object, but the Java implementations of the methods\n * will be used.\n * </ul>\n * Casting to abstract classes is not supported.\n * <p>\n * NB: for Java code running in Espresso, these methods will be intrinsified. Otherwise\n * multi-language environment is not available.\n *\n * @since 21.0\n */\npublic final class Polyglot {\n    private Polyglot() {\n        throw new RuntimeException(\"No instance of Polyglot can be created\");\n    }\n\n    /**\n     * Tests if an object is a foreign value, i.e. originates from a different Truffle language.\n     *\n     * @since 21.0\n     */\n    @SuppressWarnings(\"unused\")\n    public static boolean isForeignObject(Object object) {\n        return false;\n    }\n\n    /**\n     * If a regular {@link Class#cast} of {@code value} to {@code targetClass} succeeds,\n     * {@code Polyglot.cast} succeeds too.\n     *\n     * In addition, if {@code value} is a {@link Polyglot#isForeignObject foreign} object:\n     * <ul>","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java#L50-L86","documentation":"Error \"No instance of Polyglot can be created\" thrown in oracle/graal.","triggerScenarios":"Thrown at espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/Polyglot.java:68 when the library encounters an invalid state.","commonSituations":"Occurs when a caller violates the contract guarded by this check: No instance of Polyglot can be created","solutions":["Fix the condition reported by the error: No instance of Polyglot can be created","Check the throwing call site and ensure its documented preconditions (argument values, types, environment, or configuration) are satisfied before the call."],"exampleFix":"Validate inputs and environment so that the failing condition does not occur: No instance of Polyglot can be created","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}