{"record":{"id":"3c3f7de1da66d1a4","repo":"redisson/redisson","slug":"can-t-parse-config-3c3f7d","errorCode":null,"errorMessage":"Can't parse config","messagePattern":"Can't parse config","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"redisson-mybatis/src/main/java/org/redisson/mybatis/RedissonCache.java","lineNumber":107,"sourceCode":"    public void setMaxIdleTime(long maxIdleTime) {\n        this.maxIdleTime = maxIdleTime;\n    }\n\n    public void setMaxSize(int maxSize) {\n        this.maxSize = maxSize;\n    }\n\n    public ReadWriteLock getReadWriteLock() {\n        return null;\n    }\n\n    public void setRedissonConfig(String config) {\n        Config cfg;\n        try {\n            InputStream is = getClass().getClassLoader().getResourceAsStream(config);\n            cfg = Config.fromYAML(is);\n        } catch (Exception e) {\n            throw new IllegalArgumentException(\"Can't parse config\", e);\n        }\n\n        RedissonClient redisson = Redisson.create(cfg);\n        mapCache = getMapCache(id, redisson);\n        if (maxSize > 0) {\n            mapCache.setMaxSize(maxSize);\n        }\n    }\n\n    protected RMapCache<Object, Object> getMapCache(String id, RedissonClient redisson) {\n        return redisson.getMapCache(id);\n    }\n\n    private void check() {\n        if (mapCache == null) {\n            throw new IllegalStateException(\"Redisson config is not defined\");\n        }\n    }","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/redisson/redisson/blob/91188987c2a9023e7fedabff758681ad9b107f25/redisson-mybatis/src/main/java/org/redisson/mybatis/RedissonCache.java#L89-L125","documentation":"Thrown by RedissonCache.setRedissonConfig(String config) in the MyBatis cache adapter: loading the named classpath resource and parsing it with Config.fromYAML failed. This usually means the resource does not exist (InputStream is null, which makes fromYAML throw) or its content is not valid Redisson YAML.","triggerScenarios":"A MyBatis mapper <cache type=\"org.redisson.mybatis.RedissonCache\"/> with a cache property like <property name=\"redissonConfig\" value=\"redisson.yaml\"/> where redisson.yaml is missing from the classpath or is malformed YAML.","commonSituations":"The Redisson config file is named differently (redisson-config.yaml) or lives outside src/main/resources; typo in the property value; YAML content pasted from docs with invalid indentation; running in a fat JAR where the resource ended up under a different path.","solutions":["Verify the exact resource name passed via the 'redissonConfig' cache property exists at the classpath root","Fix the YAML content (validate against Redisson's Config schema) and rebuild so it lands in target/classes","Use an absolute packaging-safe name and check the artifact contents (jar tf) if running from an uber-jar"],"exampleFix":"<!-- before -->\n<cache type=\"org.redisson.mybatis.RedissonCache\">\n  <property name=\"redissonConfig\" value=\"config/redisson.yaml\"/>\n</cache>\n<!-- with no such resource -->\n\n<!-- after: file at src/main/resources/redisson.yaml -->\n<cache type=\"org.redisson.mybatis.RedissonCache\">\n  <property name=\"redissonConfig\" value=\"redisson.yaml\"/>\n</cache>","handlingStrategy":"validation","validationCode":"String res = \"redisson.yaml\"; // value of the redissonConfig property\nif (getClass().getClassLoader().getResource(res) == null) {\n    throw new IllegalStateException(\"Missing Redisson config resource: \" + res);\n}","typeGuard":null,"tryCatchPattern":"catch (IllegalArgumentException e) when the MyBatis cache initializes; unwrap the cause to distinguish 'resource not found' from 'YAML invalid' and fail startup loudly.","preventionTips":["Name the config file explicitly in the cache property and keep it at the classpath root","Verify packaged resources (jar tf) in the build pipeline","Never rely on relative filesystem paths for MyBatis cache configs"],"tags":["redisson","mybatis","configuration","classpath","yaml"],"backgroundTag":null,"analyzedSha":"91188987c2a9023e7fedabff758681ad9b107f25","analyzedAt":"2026-08-14T11:39:42.619Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}