Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrast-finder.conf should not be required #43

Closed
dzc34 opened this issue Apr 12, 2017 · 0 comments
Closed

contrast-finder.conf should not be required #43

dzc34 opened this issue Apr 12, 2017 · 0 comments

Comments

@dzc34
Copy link
Member

dzc34 commented Apr 12, 2017

Observed behaviour

if /etc/contrast-finder/contrast-finder.conf
file is missing, the webapp fails to start.

By default, Spring will throw an exception if it could not find a properties file or could not resolve a placeholder. That cause the application fails to start.

Solution

Ignoring exceptions

source: http://www.codejava.net/frameworks/spring/reading-properties-files-in-spring-with-propertyplaceholderconfigurer-bean#IgnoringExceptions

  <property name="location" value="file:///etc/contrast-finder/contrast-finder.conf"/>
+ <property name="ignoreResourceNotFound"         value="true" />
+ <property name="ignoreUnresolvablePlaceholders" value="true" />

Empty default value

source: http://blog.codeleak.pl/2015/09/placeholders-support-in-value.html

@Value("${my.string.property:}")
private String stringProperty;
@dzc34 dzc34 changed the title The contrast-finder.conf file should not be required contrast-finder.conf should not be required Apr 12, 2017
@dzc34 dzc34 closed this as completed in a3dcfba Apr 12, 2017
dzc34 added a commit to dzc34/Contrast-Finder that referenced this issue Apr 12, 2017
----------------------

  set version to 0.4.6
  fix Piwik (v2)
  updated documentation (typo)
  Updated Docker/pre-requisites + install documentation
  fixed Asqatasun#43 - the contrast-finder.conf file is not required
  updated */pom.xml
  Updated Dockerfile: added "LABEL org.label-schema.*"
  Updated DOC and pom.xml files for JavaDocs and OWASP Dependency-Check
  updated */pom.xml (added <license>, <url> and <organization>)
  Fixed Asqatasun#41 - Updated of outdated dependencies
  fixed Asqatasun#40 - webapp - removed jQuery UI (unused)
  Documentation: refactor "Howto build & install"
  fixed Asqatasun#38, fixed Asqatasun#39 - Upgraded maven plugins (compiler/surefire) and source/target of the Java compiler
  fixed Asqatasun#37 - Added maven-javadoc-plugin
  fixed Asqatasun#36 - Added the maven plugin "OWASP Dependency-Check"
  fix Piwik code
  webapp: added HTTP security headers (properly fixed Asqatasun#35)
  set version to 0.4.6-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant