{"record":{"id":"1a3f72c26a9892e7","repo":"alibaba/COLA","slug":"not-support-repositorytype-jobproperties-getrep","errorCode":null,"errorMessage":"not support repositoryType: ${jobProperties.getRepositoryType()}","messagePattern":"not support repositoryType: (.+?)","errorType":"exception","errorClass":"JobException","httpStatus":null,"severity":"error","filePath":"cola-components/cola-component-job/src/main/java/com/alibaba/cola/job/config/EnableJobConfiguration.java","lineNumber":33,"sourceCode":"\n@Slf4j\n@Import( {JobProperties.class, DBAutoConfiguration.class, RedisConfig.class, JsonUtil.class})\n@ComponentScan(\"com.alibaba.cola.job\")\npublic class EnableJobConfiguration {\n\n    @Resource\n    private JobProperties jobProperties;\n\n    @Bean\n    public JobRepository jobRepository() {\n        if (jobProperties.getRepositoryType() == null) {\n            jobProperties.setRepositoryType(RepositoryType.MEMORY);\n        }\n        JobRepository jobRepository = switch (jobProperties.getRepositoryType()) {\n            case DB -> new DataBaseJobRepository();\n            case REDIS -> new RedisJobRepository();\n            case MEMORY -> new MemoryJobRepository();\n            default -> throw new JobException(\"not support repositoryType: \" + jobProperties.getRepositoryType());\n        };\n        log.info(\"[cola-job]create JobRepository: \" + jobRepository.getClass().getSimpleName());\n        return jobRepository;\n    }\n}\n\n","sourceCodeStart":15,"sourceCodeEnd":40,"githubUrl":"https://github.com/alibaba/COLA/blob/352e1a867538d9cd40e1b11e4028fa652fc97557/cola-components/cola-component-job/src/main/java/com/alibaba/cola/job/config/EnableJobConfiguration.java#L15-L40","documentation":"EnableJobConfiguration.jobRepository builds the JobRepository bean from jobProperties.getRepositoryType(); the switch over RepositoryType has no matching case for the configured value and hits default, throwing JobException 'not support repositoryType'.","triggerScenarios":"Setting spring property cola.job.repository-type to a value that is not DB, REDIS, or MEMORY (e.g. a typo or a string not mapping to the enum).","commonSituations":"Typo in application.yml ('memmory', 'jdbc'); a RepositoryType enum value added in a newer version but switch not updated; config binding to a custom enum constant.","solutions":["Fix the repository-type config value to one of DB, REDIS, MEMORY","Check the RepositoryType enum for valid constants and match spelling/case","If adding a new repository type, extend the switch in EnableJobConfiguration.jobRepository"],"exampleFix":"// before\ncola:\n  job:\n    repository-type: jdbc\n// after\ncola:\n  job:\n    repository-type: DB","handlingStrategy":"validation","validationCode":"RepositoryType type = jobProperties.getRepositoryType();\nif (type != RepositoryType.DB && type != RepositoryType.REDIS && type != RepositoryType.MEMORY) {\n    throw new IllegalStateException(\"Unsupported repositoryType: \" + type);\n}","typeGuard":null,"tryCatchPattern":"try {\n    jobRepository = enableJobConfiguration.jobRepository();\n} catch (JobException e) {\n    if (e.getMessage().startsWith(\"not support repositoryType\")) {\n        log.error(\"Fix cola.job.repository-type; valid values: DB, REDIS, MEMORY\", e);\n        throw e;\n    }\n}","preventionTips":["Copy enum constant names exactly into config (case-sensitive)","List valid values next to the config key in your README/schema","Validate config at startup with a fail-fast check"],"tags":["java","config","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"352e1a867538d9cd40e1b11e4028fa652fc97557","analyzedAt":"2026-09-08T00:46:23.972Z","contentChangedAt":"2026-09-08T00:46:23.972Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}