]> source.dussan.org Git - archiva.git/commitdiff
catch NameNotFoundException to return false as we check a group existence
authorOlivier Lamy <olamy@apache.org>
Wed, 16 Jan 2013 15:16:28 +0000 (15:16 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 16 Jan 2013 15:16:28 +0000 (15:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1433977 13f79535-47bb-0310-9956-ffa450edef68

redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java

index 6520542c87c1f4e60eaeda398b2eea3e7934700f..36e88a22701531c3b7334a07dafac28144272c97 100644 (file)
@@ -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 );