smolnar82 commented on a change in pull request #55: KNOX-1162 - Logging
stacktrace for FATAL messages and displaying a meaningful error message in case
of missing/non-parsable JAAS configuration
URL: https://github.com/apache/knox/pull/55#discussion_r257807719
##########
File path:
gateway-service-remoteconfig/src/main/java/org/apache/knox/gateway/service/config/remote/zk/RemoteConfigurationRegistryJAASConfig.java
##########
@@ -49,17 +51,26 @@
private static final RemoteConfigurationMessages log =
MessagesFactory.get(RemoteConfigurationMessages.class);
// Cache the current JAAS configuration
- private Configuration delegate = Configuration.getConfiguration();
+ private final Configuration delegate;
- private AliasService aliasService;
+ private final AliasService aliasService;
- private Map<String, AppConfigurationEntry[]> contextEntries = new
HashMap<>();
+ private final Map<String, AppConfigurationEntry[]> contextEntries = new
HashMap<>();
static RemoteConfigurationRegistryJAASConfig
configure(List<RemoteConfigurationRegistryConfig> configs, AliasService
aliasService) {
return new RemoteConfigurationRegistryJAASConfig(configs,
aliasService);
}
private
RemoteConfigurationRegistryJAASConfig(List<RemoteConfigurationRegistryConfig>
configs, AliasService aliasService) {
+ try {
+ delegate = Configuration.getConfiguration();
+ } catch(Exception e) {
+ //populate the original error with a meaningful message; logging
will happen later in the upper in the call hierarchy
Review comment:
Fixed; thanks for the review!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services