Improve fix for 33774 by adding check for alternative exception to the remaining...
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 5 Sep 2007 02:14:45 +0000 (02:14 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 5 Sep 2007 02:14:45 +0000 (02:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@572859 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/realm/JNDIRealm.java

index a465277..114b013 100644 (file)
@@ -1549,6 +1549,21 @@ public class JNDIRealm extends RealmBase {
                 // Try the authentication again.
                 principal = getPrincipal(context, username);
 
+            } catch (ServiceUnavailableException e) {
+
+                // log the exception so we know it's there.
+                containerLog.warn(sm.getString("jndiRealm.exception"), e);
+
+                // close the connection so we know it will be reopened.
+                if (context != null)
+                    close(context);
+
+                // open a new directory context.
+                context = open();
+
+                // Try the authentication again.
+                principal = getPrincipal(context, username);
+
             }