Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.3-incubating
-
None
Description
It's not possible to use @Config to inject an optional value in a CDI project. None of the following work:
@Inject @Config(value = { "trellis.configFile", "TRELLIS_CONFIG_FILE" }, required=false) private File configFile;
@Inject @Config(value = { "trellis.configFile", "TRELLIS_CONFIG_FILE" }, required=false) private Optional<File> configFile;
@Inject @Config(value = { "trellis.configFile", "TRELLIS_CONFIG_FILE" }) private Optional<File> configFile;
All throw a
org.apache.tamaya.ConfigException: Cannot resolve any of the possible configuration keys: [trellis.configFile, TRELLIS_CONFIG_FILE]. Please provide one of the given keys with a value in your configuration sources.
Attachments
Issue Links
- links to