Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-1404

Handle property files inside jars



    • Improvement
    • Resolution: Fixed
    • Minor
    • 2.4.0
    • 2.0.0, 2.1.0, 2.2.2, 2.3.0
    • gsh, subject API, UI
    • None
    • Specifically affects Windows OS, and JBoss 7 with VFS deployments


      In a few places in Grouper, the code expects property files to be readable filesystem files. However, there are installations where this may not be ideal. Local build practices may prefer environment-specific properties in a companion jar, rather than individual files. Or, Java containers such JBoss 7 work in a virtual filesystem, where files aren't readable via Java's FileInputStream().

      There are two places where this causes issues:

      1) This is a Windows-specific issue. Other than ldap.properties referenced in sources.xml, all the other properties are actually readable. However, GrouperStartup.printConfigOnce() calculates the canonical filesystem path for certain files in order to log diagnostics. For property files inside a jar, the call attempts to canonicalize e.g. "...my-custom-props.jar!grouper.properties". It works ok except on Windows, which chokes on the "!". A workaround is to set configuration.display.startup.message=false, which avoids the attempt to calculate the filepath.

      2) When an LDAP source in sources.xml references properties via the ldapProperties_file parameter, this must be a physical filesystem file. In situations where an unpacked war isn't an option, the workaround is to host ldap.properties somewhere outside the Java container, and reference it by full path in sources.xml.




            chris.hyzer@at.internet2.edu Chris Hyzer
            chad.redman@at.internet2.edu Chad Redman (unc.edu)
            0 Vote for this issue
            2 Start watching this issue