{"record":{"id":"f0df90b054968bf4","repo":"jeecgboot/JeecgBoot","slug":"jobinfo-glue-gluetype-invalid","errorCode":"jobinfo_glue_gluetype_invalid","errorMessage":"jobinfo_glue_gluetype_invalid","messagePattern":"jobinfo_glue_gluetype_invalid","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobCodeController.java","lineNumber":52,"sourceCode":"@RequestMapping(\"/jobcode\")\npublic class JobCodeController {\n\tprivate static final Logger logger = LoggerFactory.getLogger(JobCodeController.class);\n\t\n\t@Resource\n\tprivate XxlJobInfoMapper xxlJobInfoMapper;\n\t@Resource\n\tprivate XxlJobLogGlueMapper xxlJobLogGlueMapper;\n\n\t@RequestMapping\n\tpublic String index(HttpServletRequest request, Model model, @RequestParam(\"jobId\") int jobId) {\n\t\tXxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobId);\n\t\tList<XxlJobLogGlue> jobLogGlues = xxlJobLogGlueMapper.findByJobId(jobId);\n\n\t\tif (jobInfo == null) {\n\t\t\tthrow new RuntimeException(I18nUtil.getString(\"jobinfo_glue_jobid_invalid\"));\n\t\t}\n\t\tif (GlueTypeEnum.BEAN == GlueTypeEnum.match(jobInfo.getGlueType())) {\n\t\t\tthrow new RuntimeException(I18nUtil.getString(\"jobinfo_glue_gluetype_invalid\"));\n\t\t}\n\n\t\t// valid jobGroup permission\n\t\tJobGroupPermissionUtil.validJobGroupPermission(request, jobInfo.getJobGroup());\n\n\t\t// Glue类型-字典\n\t\tmodel.addAttribute(\"GlueTypeEnum\", GlueTypeEnum.values());\n\n\t\tmodel.addAttribute(\"jobInfo\", jobInfo);\n\t\tmodel.addAttribute(\"jobLogGlues\", jobLogGlues);\n\t\treturn \"business/job.code\";\n\t}\n\t\n\t@RequestMapping(\"/save\")\n\t@ResponseBody\n\tpublic Response<String> save(HttpServletRequest request,\n\t\t\t\t\t\t\t\t @RequestParam(\"id\") int id,\n\t\t\t\t\t\t\t\t @RequestParam(\"glueSource\") String glueSource,","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobCodeController.java#L34-L70","documentation":"Thrown by JobCodeController.index when the job exists but its glueType is GlueTypeEnum.BEAN. The GLUE code editor only applies to jobs that use script-based glue types (e.g., GLUE_GROOVY, GLUE_SHELL, GLUE_PYTHON, GLUE_PHP, GLUE_NODEJS, GLUE_POWERSHELL). BEAN-type jobs are implemented as Spring beans in Java code and have no editable GLUE script, so opening the code editor for them is a logical error. The message comes from i18n key 'jobinfo_glue_gluetype_invalid'.","triggerScenarios":"User clicks the 'GLUE Code' button on a BEAN-type job in the job list. The URL /jobcode?jobId=X is manually entered for a job whose glue_type is 'BEAN'. A job's glue_type was changed from a script type to BEAN, but the user still tries to access the old code editor link.","commonSituations":"New admin unfamiliar with the distinction between BEAN jobs (code compiled into the application) and GLUE jobs (script edited at runtime). Job was originally created as GLUE_GROOVY then reconfigured as BEAN. UI bug that shows the GLUE code button for BEAN-type jobs.","solutions":["Check the job's glue_type: SELECT id, glue_type FROM xxl_job_info WHERE id = <jobId> — if it's 'BEAN', there is no GLUE code to edit.","If the job should have editable GLUE code, update its glue_type to the appropriate script type (e.g., GLUE_GROOVY) in the job edit page.","If the job is correctly BEAN-type, navigate away from the code editor — the job logic lives in the compiled Spring bean identified by the executorHandler field.","Hide or disable the 'GLUE Code' button in the job list UI for BEAN-type jobs to prevent this error."],"exampleFix":"// before: GLUE code button shown for all jobs\n<el-button @click=\"openGlueCode(row.id)\">GLUE Code</el-button>\n\n// after: only show for script-based glue types\n<el-button\n  v-if=\"row.glueType !== 'BEAN'\"\n  @click=\"openGlueCode(row.id)\">\n  GLUE Code\n</el-button>","handlingStrategy":"validation","validationCode":"// Validate glue type is script-based before opening code editor\npublic boolean isGlueEditable(int jobId) {\n    XxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobId);\n    if (jobInfo == null) return false;\n    GlueTypeEnum type = GlueTypeEnum.match(jobInfo.getGlueType());\n    return type != GlueTypeEnum.BEAN;\n}","typeGuard":"// Check if a glue type supports code editing\npublic boolean isScriptGlueType(String glueType) {\n    GlueTypeEnum type = GlueTypeEnum.match(glueType);\n    return type != null && type != GlueTypeEnum.BEAN;\n}","tryCatchPattern":"try {\n    return \"business/job.code\";\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"jobinfo_glue_gluetype_invalid\")) {\n        model.addAttribute(\"error\", \"This job uses BEAN mode and does not support GLUE code editing.\");\n        return \"redirect:/jobinfo\";\n    }\n    throw e;\n}","preventionTips":["Hide the 'GLUE Code' button in the UI for BEAN-type jobs.","Educate users on the difference: BEAN jobs use compiled Spring beans; GLUE jobs use editable scripts.","If a job needs editable code, change its glue_type from BEAN to a script type (e.g., GLUE_GROOVY) in the job edit page.","Validate the glue type before navigating to the code editor page."],"tags":["xxl-job","glue","job-management","validation","i18n"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}