{"record":{"id":"119059d3d847077b","repo":"jenkinsci/jenkins","slug":"unable-to-create-expression-text","errorCode":null,"errorMessage":"Unable to create expression: ${text}","messagePattern":"Unable to create expression: (.+?)","errorType":"exception","errorClass":"JellyException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/hudson/ExpressionFactory2.java","lineNumber":31,"sourceCode":"import org.apache.commons.jexl.JexlContext;\nimport org.kohsuke.stapler.Stapler;\nimport org.kohsuke.stapler.StaplerRequest2;\nimport org.springframework.security.access.AccessDeniedException;\n\n/**\n * {@link ExpressionFactory} so that security exception aborts the page rendering.\n *\n * @author Kohsuke Kawaguchi\n*/\nfinal class ExpressionFactory2 implements ExpressionFactory {\n    @Override\n    public Expression createExpression(String text) throws JellyException {\n        try {\n            return new JexlExpression(\n                org.apache.commons.jexl.ExpressionFactory.createExpression(text)\n            );\n        } catch (Exception e) {\n            throw new JellyException(\"Unable to create expression: \" + text, e);\n        }\n    }\n\n    /*\n     * Copyright 2002,2004 The Apache Software Foundation.\n     *\n     * Licensed under the Apache License, Version 2.0 (the \"License\");\n     * you may not use this file except in compliance with the License.\n     * You may obtain a copy of the License at\n     *\n     *      http://www.apache.org/licenses/LICENSE-2.0\n     *\n     * Unless required by applicable law or agreed to in writing, software\n     * distributed under the License is distributed on an \"AS IS\" BASIS,\n     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n     * See the License for the specific language governing permissions and\n     * limitations under the License.\n     */","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/jenkinsci/jenkins/blob/2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc/core/src/main/java/hudson/ExpressionFactory2.java#L13-L49","documentation":"Thrown by ExpressionFactory2.createExpression when the Apache Commons JEXL parser cannot compile the given expression text. Jenkins wraps all JEXL failures (parse errors, security violations) in a JellyException so that view rendering aborts at the point of the bad expression rather than emitting a half-rendered page.","triggerScenarios":"A Jelly/JEXL expression in a .jelly view contains a syntax error; an expression references an undefined namespace or operator; JEXL security policy rejects the expression; expression text is malformed after a refactor of message properties.","commonSituations":"Editing a .jelly file and breaking ${...} syntax; upgrading a plugin that changed a JEXL helper; typo in an attribute expression; using JEXL features disallowed by the configured JexlSandbox.","solutions":["Open the failing .jelly view and fix the expression syntax reported in the JellyException.","Check the exact expression text echoed in the error message and validate it against JEXL syntax.","If the expression worked before, bisect recent view/property changes.","Run the view in ?safeMode or with JEXL debug logging to isolate the failing token."],"exampleFix":"// before\n<j:set var=\"x\" value=\"${a +}\"/>  <!-- syntax error -->\n// after\n<j:set var=\"x\" value=\"${a + b}\"/>","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n    ExpressionFactory f = ...;\n    f.createExpression(text);\n} catch (JellyException e) {\n    // 'Unable to create expression' — surface to the view author, do not retry blindly\n    LOGGER.log(Level.WARNING, \"Bad Jelly/JEXL expression: \" + text, e);\n}","preventionTips":["Lint .jelly expressions during the build with the jelly test harness.","Keep JEXL expressions simple; test them in isolation before deploying views.","Review expression changes in code review for syntax errors."],"tags":["jelly","jexl","view-rendering"],"backgroundTag":null,"analyzedSha":"2e228ff40b14dbc8b14ffbc6edf0e4383cf744fc","analyzedAt":"2026-08-14T07:07:15.274Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}