Skip to content

Instantly share code, notes, and snippets.

@barkbay
Created November 27, 2012 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barkbay/4153107 to your computer and use it in GitHub Desktop.
Save barkbay/4153107 to your computer and use it in GitHub Desktop.
ZooKeeperSaslClient should catch any RuntimeException throwed by getAppConfigurationEntry(..)
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) {
@mishras
Copy link

mishras commented Mar 6, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment