diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java index 9e780e3..7075f29 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java @@ -69,7 +69,14 @@ public class AdditionalPropertiesConfig implements EnvironmentPostProcessor { for (String prefix : resourceFilePrefixes) { try { ClassPathResource classPathResource = new ClassPathResource(prefix + "-" + profile + ".properties"); - classPathResource.getFile().canRead(); + + /* + * Do not use getFile() method. + * Instead, use getInputStream(), required by Tomcat/WAR deployment + */ + + classPathResource.getInputStream(); + classPathResources.add(classPathResource); System.out.printf( "Profile properties file found: %s\n",