public
Last active

ZooKeeperSaslClient should catch any RuntimeException throwed by getAppConfigurationEntry(..)

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
diff --git a/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java b/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
index 6087e99..70b8ea1 100644
--- a/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
+++ b/src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java
@@ -92,10 +92,10 @@ public class ZooKeeperSaslClient {
String clientSection = System.getProperty(ZooKeeperSaslClient.LOGIN_CONTEXT_NAME_KEY, "Client");
// Note that 'Configuration' here refers to javax.security.auth.login.Configuration.
AppConfigurationEntry entries[] = null;
- SecurityException securityException = null;
+ RuntimeException securityException = null;
try {
entries = Configuration.getConfiguration().getAppConfigurationEntry(clientSection);
- } catch (SecurityException e) {
+ } catch (RuntimeException e) {
// handle below: might be harmless if the user doesn't intend to use JAAS authentication.
securityException = e;
}
@@ -512,7 +512,7 @@ public class ZooKeeperSaslClient {
// scheme, or tunnelled authentication has completed (successfully or
// not), and all server SASL messages have been received.
return false;
- } catch (SecurityException e) {
+ } catch (RuntimeException e) {
// Thrown if the caller does not have permission to retrieve the Configuration.
// In this case, simply returning false is correct.
if (LOG.isDebugEnabled() == true) {

Thanks. I ran in to the same problem when setting up SolrCloud (with independent ZooKeeper) on Weblogic12c.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.