{"record":{"id":"4cc6069929780ed8","repo":"xuxueli/xxl-job","slug":"xxl-job-executor-accesstoken-empty","errorCode":null,"errorMessage":"xxl-job executor accessToken empty.","messagePattern":"xxl-job executor accessToken empty\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java","lineNumber":144,"sourceCode":"     * start\n     */\n    public void start() throws Exception {\n\n        // valid enabled\n        if (!enabled) {\n            logger.info(\">>>>>>>>>>> xxl-job executor start fail, enabled:{}\", enabled);\n            return;\n        }\n\n        // valid param\n        if (StringTool.isBlank(adminAddresses)) {\n            throw new RuntimeException(\"xxl-job executor adminAddresses empty.\");\n        }\n        if (StringTool.isBlank(appname)) {\n            throw new RuntimeException(\"xxl-job executor appname empty.\");\n        }\n        if (StringTool.isBlank(accessToken)) {\n            throw new RuntimeException(\"xxl-job executor accessToken empty.\");\n        }\n\n        // bind instance\n        xxlJobExecutor = this;\n\n        // init logpath\n        XxlJobFileAppender.initLogPath(logPath);\n\n        // init invoker, admin-client\n        initAdminBizList();\n\n        // 1、init JobLogFileCleanThread\n        jobLogFileCleanThreadHelper = new JobLogFileCleanThreadHelper();\n        jobLogFileCleanThreadHelper.start(logRetentionDays);\n\n        // 2、init TriggerCallbackThread\n        triggerCallbackThreadHelper = new TriggerCallbackThreadHelper();\n        triggerCallbackThreadHelper.start(this);","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java#L126-L162","documentation":"Thrown by XxlJobExecutor.start() when the accessToken field is blank. The access token must match between admin and executor for authenticated RPC; a blank token is rejected to prevent an unauthenticated registration path.","triggerScenarios":"Calling start() with accessToken unset or whitespace (e.g. xxl.job.accessToken not configured, or executor-side token differs from being set at all).","commonSituations":"xxl.job.accessToken missing from the executor's application.properties; token configured only on the admin side; env var not injected; migrating from a version that allowed empty tokens.","solutions":["Set xxl.job.accessToken (or setAccessToken) to a non-blank shared secret identical on admin and executor.","Confirm the executor's token equals the admin's xxl.job.accessToken exactly.","Inject the token via env var / secret store rather than hard-coding."],"exampleFix":"// before\nxxlJobExecutor.setAccessToken(\"\");\n// after\nxxlJobExecutor.setAccessToken(System.getenv(\"XXL_JOB_ACCESS_TOKEN\"));","handlingStrategy":"validation","validationCode":"String token = config.getAccessToken();\nif (StringTool.isBlank(token)) {\n    throw new IllegalStateException(\"xxl.job.accessToken is required\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    xxlJobExecutor.start();\n} catch (RuntimeException e) {\n    log.error(\"executor start failed: {}\", e.getMessage());\n}","preventionTips":["Load the access token from a secret store / env var, never hard-code.","Keep admin and executor tokens identical.","Add a config sanity check that fails boot on a blank token."],"tags":["configuration","startup","security","executor","authentication"],"backgroundTag":null,"analyzedSha":"e74c784f68f81fa89cb350913ef15794865d7b12","analyzedAt":"2026-08-14T04:22:43.715Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}