{"record":{"id":"a1e3e1cdd6fc25cf","repo":"apereo/cas","slug":"error-loading-resources-from-bundle","errorCode":null,"errorMessage":"Error loading resources from bundle: [{}] - [{}]","messagePattern":"Error loading resources from bundle: \\[(.+?)\\] - \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-themes-core/src/main/java/org/apereo/cas/services/web/AggregateCasThemeSource.java","lineNumber":46,"sourceCode":"    protected MessageSource createMessageSource(\n        @NonNull\n        final String basename) {\n        val source = new StaticMessageSource();\n        source.setParentMessageSource(super.createMessageSource(basename));\n        casProperties.getView().getTemplatePrefixes()\n            .stream()\n            .map(prefix -> Strings.CI.appendIfMissing(prefix, \"/\").concat(basename).concat(\".properties\"))\n            .filter(ResourceUtils::doesResourceExist)\n            .forEach(path -> {\n                try (val is = ResourceUtils.getRawResourceFrom(path).getInputStream()) {\n                    val properties = new Properties();\n                    properties.load(is);\n                    properties.forEach((key, value) -> {\n                        LOGGER.trace(\"Loading theme property [{}] from [{}]\", key, path);\n                        source.addMessage(key.toString(), Locale.ENGLISH, value.toString());\n                    });\n                } catch (final IOException e) {\n                    LOGGER.warn(\"Error loading resources from bundle: [{}] - [{}]\", path, e.getMessage());\n                }\n            });\n        return source;\n    }\n}\n","sourceCodeStart":28,"sourceCodeEnd":52,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-themes-core/src/main/java/org/apereo/cas/services/web/AggregateCasThemeSource.java#L28-L52","documentation":"AggregateCasThemeSource.createMessageSource scans configured theme resource bundle paths and loads each as a Java properties file into a Spring MessageSource. When reading a bundle throws an IOException (missing file, unreadable file, or stream error), the theme source logs this warning and skips that bundle rather than failing startup. The result is that messages/custom text defined in the skipped bundle will be missing at runtime.","triggerScenarios":"A configured theme resource bundle path (cas.themes.* bundle locations) points to a properties file that does not exist on the classpath or filesystem, or cannot be opened/read as an InputStream.","commonSituations":"Custom theme deployed without its messages.properties; typo in bundle path or basename; theme resources packaged in a WAR overlay but path misconfigured; file permissions block read after redeploy.","solutions":["Verify each configured theme bundle path exists and is readable at the location CAS resolves it from (classpath vs file path).","Correct the bundle path/basename in cas.properties or the theme properties configuration.","Package the missing properties file into the theme JAR/WAR overlay.","Check file permissions on external theme resource directories."],"exampleFix":"// before\ncas.themes.custom-theme.messages-basename=classpath:themes/custom/messages\n// after (file actually exists at themes/custom-theme/messages.properties)\ncas.themes.custom-theme.messages-basename=classpath:themes/custom-theme/messages","handlingStrategy":"validation","validationCode":"// before startup, verify each configured bundle resolves\nList.of(\"classpath:themes/custom-theme/messages\").forEach(base -> {\n    var path = base.replaceFirst(\"^classpath:\", \"\");\n    if (AggregateCasThemeSource.class.getResource(path + \".properties\") == null)\n        throw new IllegalStateException(\"Missing theme bundle: \" + base);\n});","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a smoke test that loads every configured theme bundle basename.","Keep theme bundles inside the overlay WAR and verify after build.","Watch for this WARN in startup logs during deployment verification."],"tags":["i18n","themes","resource-loading","io"],"backgroundTag":"file-not-found","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}