jeecgboot/JeecgBoot · error · RuntimeException

jobinfo_glue_jobid_invalid

jobinfo_glue_jobid_invalid

Error message

jobinfo_glue_jobid_invalid

What it means

Thrown by JobCodeController.index when xxlJobInfoMapper.loadById(jobId) returns null, meaning the requested job ID does not exist in the xxl_job_info table. This controller handles the GLUE script editor view — it loads job metadata to display the code editing page. A null jobInfo means the job was deleted, the ID is wrong, or the database is out of sync. The error message comes from i18n key 'jobinfo_glue_jobid_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:49

 * @author xuxueli 2015-12-19 16:13:16
 */
@Controller
@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

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Verify the job exists: SELECT id, job_desc, glue_type FROM xxl_job_info WHERE id = <jobId>.
  2. If the job was deleted, navigate back to the job list and select an existing job.
  3. Clear stale bookmarks and use the job list page to access GLUE code editors.
  4. Add client-side validation to check if the job exists before navigating to the code editor (AJAX call to job list API).

Example fix

// before: direct navigation to potentially stale URL
window.location.href = '/jobcode?jobId=' + jobId;

// after: validate job exists before navigating
const exists = await checkJobExists(jobId);
if (!exists) {
    alert('任务不存在或已被删除');
    refreshJobList();
    return;
}
window.location.href = '/jobcode?jobId=' + jobId;
Defensive patterns

Strategy: validation

Validate before calling

// Validate job exists before navigating to GLUE code editor
public boolean jobExists(int jobId) {
    return xxlJobInfoMapper.loadById(jobId) != null;
}

// In controller/API:
if (!jobExists(jobId)) {
    return Response.ofFail(I18nUtil.getString("jobinfo_glue_jobid_invalid"));
}

Try / catch

try {
    // Controller method body — navigation to job code page
    return "business/job.code";
} catch (RuntimeException e) {
    if (e.getMessage().contains("jobinfo_glue_jobid_invalid")) {
        // Redirect to job list with error message
        model.addAttribute("error", "Job does not exist");
        return "redirect:/jobinfo";
    }
    throw e;
}

Prevention

When it happens

Trigger: Navigating to the GLUE code editor URL with a jobId that doesn't exist: /jobcode?jobId=99999. The job was deleted but the user's browser still has a cached bookmark/link. A concurrent admin deleted the job between the user opening the job list and clicking into the code editor. The jobId parameter was tampered with.

Common situations: Stale bookmark to a deleted job's GLUE editor. URL manipulation by users. Race condition between job deletion and another user accessing the code editor. Database inconsistency where xxl_job_log_glue references a jobId that no longer exists in xxl_job_info.

Related errors


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