Created
November 27, 2012 08:18
-
-
Save barkbay/4153107 to your computer and use it in GitHub Desktop.
ZooKeeperSaslClient should catch any RuntimeException throwed by getAppConfigurationEntry(..)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. I ran in to the same problem when setting up SolrCloud (with independent ZooKeeper) on Weblogic12c.