{"record":{"id":"d8da99181e0163b7","repo":"redisson/redisson","slug":"unable-to-locate-redisson-configuration-d8da99","errorCode":null,"errorMessage":"Unable to locate Redisson configuration","messagePattern":"Unable to locate Redisson configuration","errorType":"exception","errorClass":"CacheException","httpStatus":null,"severity":"critical","filePath":"redisson-hibernate/redisson-hibernate-72/src/main/java/org/redisson/hibernate/RedissonRegionFactory.java","lineNumber":113,"sourceCode":"    }\n\n    protected RedissonClient createRedissonClient(StandardServiceRegistry registry, Map properties) {\n        Config config = null;\n        if (!properties.containsKey(REDISSON_CONFIG_PATH)) {\n            config = loadConfig(RedissonRegionFactory.class.getClassLoader(), \"redisson.json\");\n            if (config == null) {\n                config = loadConfig(RedissonRegionFactory.class.getClassLoader(), \"redisson.yaml\");\n            }\n        } else {\n            String configPath = ConfigurationHelper.getString(REDISSON_CONFIG_PATH, properties);\n            config = loadConfig(RedissonRegionFactory.class.getClassLoader(), configPath);\n            if (config == null) {\n                config = loadConfig(configPath);\n            }\n        }\n        \n        if (config == null) {\n            throw new CacheException(\"Unable to locate Redisson configuration\");\n        }\n\n        return Redisson.create(config);\n    }\n    \n    private Config loadConfig(String configPath) {\n        try {\n            return Config.fromYAML(new File(configPath));\n        } catch (Exception e) {\n            throw new CacheException(\"Can't parse default config\", e);\n        }\n    }\n    \n    private Config loadConfig(ClassLoader classLoader, String fileName) {\n        InputStream is = classLoader.getResourceAsStream(fileName);\n        if (is != null) {\n            try {\n                return Config.fromYAML(is);","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/redisson/redisson/blob/91188987c2a9023e7fedabff758681ad9b107f25/redisson-hibernate/redisson-hibernate-72/src/main/java/org/redisson/hibernate/RedissonRegionFactory.java#L95-L131","documentation":"Thrown by RedissonRegionFactory.createRedissonClient when no Redisson configuration could be located. The factory first tries the path in 'hibernate.cache.redisson.file', then 'redisson.yaml' on the classpath (and as a file) when no path is given; if all attempts return null, Hibernate cache startup aborts with this CacheException.","triggerScenarios":"No hibernate.cache.redisson.file property set AND no redisson.yaml/redisson.json resource on the classpath; or hibernate.cache.redisson.file points to a path that exists neither on the classpath nor on the filesystem (both loadConfig overloads return null).","commonSituations":"New project using Redisson as Hibernate 2nd-level cache without shipping a config file; config file named differently (redisson-config.yaml) or placed in a directory not on the classpath; running tests where src/main/resources is not on the test classpath.","solutions":["Add a valid redisson.yaml to src/main/resources (classpath root)","Or set hibernate.cache.redisson.file=/path/to/redisson.yaml (filesystem) or a classpath resource name","Verify the file is actually packaged (check the built JAR/WAR contents) and the property name has no typo"],"exampleFix":"# before: no redisson config anywhere\nhibernate.cache.region.factory_class=org.redisson.hibernate.RedissonRegionFactory\n\n# after: point at an explicit file\nhibernate.cache.region.factory_class=org.redisson.hibernate.RedissonRegionFactory\nhibernate.cache.redisson.file=redisson.yaml\n# and add src/main/resources/redisson.yaml:\n# singleServerConfig:\n#   address: \"redis://127.0.0.1:6379\"","handlingStrategy":"validation","validationCode":"String path = properties.getProperty(\"hibernate.cache.redisson.file\");\nboolean classpathOk = RedissonRegionFactory.class.getClassLoader()\n        .getResource(\"redisson.yaml\") != null;\nboolean fileOk = path != null && new File(path).isFile();\nif (path == null && !classpathOk || path != null && !fileOk && !classpathOk) {\n    throw new IllegalStateException(\"No Redisson config found: set hibernate.cache.redisson.file or add redisson.yaml to the classpath\");\n}","typeGuard":null,"tryCatchPattern":"catch (CacheException e) during SessionFactory build and surface 'Redisson configuration missing' to deployment tooling; configuration problem, no retry value.","preventionTips":["Ship a default redisson.yaml in every environment's artifact","Add an integration test that boots the SessionFactory once per module","Alert when the config file is absent from the packaged artifact in CI"],"tags":["redisson","hibernate","configuration","classpath","l2-cache"],"backgroundTag":null,"analyzedSha":"91188987c2a9023e7fedabff758681ad9b107f25","analyzedAt":"2026-08-14T11:39:42.619Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}