On 16/12/2009 12:30, Tim Funk wrote:
> Would it be worth making this configurable? For example:
There are probably some use cases where that would be useful. I don't
feel that strongly about it myself but I'm not going to get in your way
if you want to add it.
Mark
>
> boolean ignoreFailedStarts = false;
> ...
> } catch (LifecycleException e) {
> if (ignoreFailedStarts) {
> // If realm doesn't start can't authenticate against it
> iter.remove();
> log.error(sm.getString("combinedRealm.realmStartFail",
> realm.getInfo()), e);
> } else {
> throw e;
> }
> }
>
>
> On 12/16/2009 6:05 AM, [email protected] wrote:
>> Author: markt
>> Date: Wed Dec 16 11:05:09 2009
>> New Revision: 891187
>>
>> URL: http://svn.apache.org/viewvc?rev=891187&view=rev
>> Log:
>> Fix bug 47841: CombinedRealm fails to switch to other realm
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=47841
>> Handle failure of sub-realm during combined realm start
>>
>> Modified:
>> tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java
>> tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties
>>
>> Modified: tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java?rev=891187&r1=891186&r2=891187&view=diff
>>
>> ==============================================================================
>>
>> --- tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java
>> (original)
>> +++ tomcat/trunk/java/org/apache/catalina/realm/CombinedRealm.java Wed
>> Dec 16 11:05:09 2009
>> @@ -20,6 +20,7 @@
>> import java.security.Principal;
>>
>> import java.security.cert.X509Certificate;
>> +import java.util.Iterator;
>> import java.util.LinkedList;
>> import java.util.List;
>>
>> @@ -227,9 +228,19 @@
>> @Override
>> public void start() throws LifecycleException {
>> // Start 'sub-realms' then this one
>> - for (Realm realm : realms) {
>> + Iterator<Realm> iter = realms.iterator();
>> +
>> + while (iter.hasNext()) {
>> + Realm realm = iter.next();
>> if (realm instanceof Lifecycle) {
>> - ((Lifecycle) realm).start();
>> + try {
>> + ((Lifecycle) realm).start();
>> + } catch (LifecycleException e) {
>> + // If realm doesn't start can't authenticate
>> against it
>> + iter.remove();
>> +
>> log.error(sm.getString("combinedRealm.realmStartFail",
>> + realm.getInfo()), e);
>> + }
>> }
>> }
>> super.start();
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]