struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgm <str...@rgm.nu>
Subject Diagnosing problem loading "theme.properties" on JBoss 7 with Struts 2.3.16
Date Thu, 12 Dec 2013 17:21:39 GMT
I'm trying to figure out why "theme.properties" isn't loaded from the
filesystem on my JBoss 7 system and believe that this is a useful change to
BaseTemplateEngine.java:

    private InputStream createFileInputStream(File propFile) throws
FileNotFoundException {
        InputStream is = null;
        if (propFile.exists()) {
            is = new FileInputStream(propFile);
+        } else {
+          throw new FileNotFoundException(propFile.toString());
+        }
        return is;
    }

This change allows the following message to be seen from the calling method:
  LOG.warn("Unable to find file in filesystem [" +
propFile.getAbsolutePath() + "]");

Without this change, no warning is printed (unless there's a problem
creating the FileInputStream).

Alternately, one could remove the check for "propFile.exists()" entirely
and allow the constructor for FileInputStream to throw the exception itself.

-rgm

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message