jeecgboot/JeecgBoot · error · RuntimeException

jobinfo_glue_gluetype_invalid

jobinfo_glue_gluetype_invalid

Error message

jobinfo_glue_gluetype_invalid

What it means

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'.

Source

Thrown at jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobCodeController.java:52

@RequestMapping("/jobcode")
public class JobCodeController {
	private static final Logger logger = LoggerFactory.getLogger(JobCodeController.class);
	
	@Resource
	private XxlJobInfoMapper xxlJobInfoMapper;
	@Resource
	private XxlJobLogGlueMapper xxlJobLogGlueMapper;

	@RequestMapping
	public String index(HttpServletRequest request, Model model, @RequestParam("jobId") int jobId) {
		XxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobId);
		List<XxlJobLogGlue> jobLogGlues = xxlJobLogGlueMapper.findByJobId(jobId);

		if (jobInfo == null) {
			throw new RuntimeException(I18nUtil.getString("jobinfo_glue_jobid_invalid"));
		}
		if (GlueTypeEnum.BEAN == GlueTypeEnum.match(jobInfo.getGlueType())) {
			throw new RuntimeException(I18nUtil.getString("jobinfo_glue_gluetype_invalid"));
		}

		// valid jobGroup permission
		JobGroupPermissionUtil.validJobGroupPermission(request, jobInfo.getJobGroup());

		// Glue类型-字典
		model.addAttribute("GlueTypeEnum", GlueTypeEnum.values());

		model.addAttribute("jobInfo", jobInfo);
		model.addAttribute("jobLogGlues", jobLogGlues);
		return "business/job.code";
	}
	
	@RequestMapping("/save")
	@ResponseBody
	public Response<String> save(HttpServletRequest request,
								 @RequestParam("id") int id,
								 @RequestParam("glueSource") String glueSource,

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. 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.
  2. 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.
  3. 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.
  4. Hide or disable the 'GLUE Code' button in the job list UI for BEAN-type jobs to prevent this error.

Example fix

// before: GLUE code button shown for all jobs
<el-button @click="openGlueCode(row.id)">GLUE Code</el-button>

// after: only show for script-based glue types
<el-button
  v-if="row.glueType !== 'BEAN'"
  @click="openGlueCode(row.id)">
  GLUE Code
</el-button>
Defensive patterns

Strategy: validation

Validate before calling

// Validate glue type is script-based before opening code editor
public boolean isGlueEditable(int jobId) {
    XxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobId);
    if (jobInfo == null) return false;
    GlueTypeEnum type = GlueTypeEnum.match(jobInfo.getGlueType());
    return type != GlueTypeEnum.BEAN;
}

Type guard

// Check if a glue type supports code editing
public boolean isScriptGlueType(String glueType) {
    GlueTypeEnum type = GlueTypeEnum.match(glueType);
    return type != null && type != GlueTypeEnum.BEAN;
}

Try / catch

try {
    return "business/job.code";
} catch (RuntimeException e) {
    if (e.getMessage().contains("jobinfo_glue_gluetype_invalid")) {
        model.addAttribute("error", "This job uses BEAN mode and does not support GLUE code editing.");
        return "redirect:/jobinfo";
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14). Data as JSON: /api/errors/f0df90b054968bf4. Report an issue: GitHub.