From: Olivier Lamy Date: Wed, 16 Jan 2013 15:16:28 +0000 (+0000) Subject: catch NameNotFoundException to return false as we check a group existence X-Git-Tag: redback-2.1~100 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1222b2b217787d5d8874239850ef37d9612a6019;p=archiva.git catch NameNotFoundException to return false as we check a group existence git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1433977 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java index 6520542c8..36e88a227 100644 --- a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java +++ b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java @@ -33,6 +33,7 @@ import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.inject.Named; +import javax.naming.NameNotFoundException; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attribute; @@ -205,6 +206,11 @@ public class DefaultLdapRoleMapper return namingEnumeration.hasMore(); } + catch ( NameNotFoundException e ) + { + log.debug( "group {} for role {} not found", groupName, roleName ); + return false; + } catch ( LdapException e ) { throw new MappingException( e.getMessage(), e );