3 Replies Latest reply on Mar 17, 2009 8:55 PM by Ron DiFrango

    Identity Management with Active Directory using it  Create R

    Ron DiFrango Newbie

      I have my JBoss Portal instance configured to work with Active directory. Now, I have a situation where I need to dynamically create roles. When I do that I get the following exception:

      Caused by: org.jboss.portal.identity.IdentityException: Failed to create role
       at org.jboss.portal.identity.ldap.LDAPRoleModuleImpl.createRole(LDAPRoleModuleImpl.java:211)
       at org.jboss.portal.core.identity.cache.CachedLDAPRoleModuleWrapper.createRole(CachedLDAPRoleModuleWrapper.java:107)
       at org.hhmi.integration.projects.ProjectsServiceImpl.createRoles(ProjectsServiceImpl.java:127)
       ... 229 more
      Caused by: javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - 0000207C: UpdErr: DSID-03150F6B, problem 6002 (OBJ_CLASS_VIOLATION), data 0
      


        • 1. Re: Identity Management with Active Directory using it  Crea
          Ron DiFrango Newbie

          I noticed that my code got cut off. Here is more info:

          Caused by: org.jboss.portal.identity.IdentityException: Failed to create role
           at org.jboss.portal.identity.ldap.LDAPRoleModuleImpl.createRole(LDAPRoleModuleImpl.java:211)
           at org.jboss.portal.core.identity.cache.CachedLDAPRoleModuleWrapper.createRole(CachedLDAPRoleModuleWrapper.java:107)
           at org.hhmi.integration.projects.ProjectsServiceImpl.createRoles(ProjectsServiceImpl.java:127)
           ... 229 more
          Caused by: javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - 0000207C: UpdErr: DSID-03150F6B, problem 6002 (OBJ_CLASS_VIOLATION), data 0
          


          • 2. Re: Identity Management with Active Directory using it  Crea
            Ron DiFrango Newbie

            And my actual code:

            Caused by: org.jboss.portal.identity.IdentityException: Failed to create role
             at org.jboss.portal.identity.ldap.LDAPRoleModuleImpl.createRole(LDAPRoleModuleImpl.java:211)
             at org.jboss.portal.core.identity.cache.CachedLDAPRoleModuleWrapper.createRole(CachedLDAPRoleModuleWrapper.java:107)
             at org.hhmi.integration.projects.ProjectsServiceImpl.createRoles(ProjectsServiceImpl.java:127)
             ... 229 more
            Caused by: javax.naming.directory.SchemaViolationException: [LDAP: error code 65 - 0000207C: UpdErr: DSID-03150F6B, problem 6002 (OBJ_CLASS_VIOLATION), data 0
            


            • 3. Re: Identity Management with Active Directory using it  Crea
              Ron DiFrango Newbie

              For some reason cut and paste was not working. Code is here:

              // See: http://docs.jboss.org/jbportal/v2.2/javadoc/org/jboss/portal/core/modules/RoleModule.html#createRole(java.lang.String,%20java.lang.String)
               // name - the role name
               // displayName - the role display name
               for (Projects.ProjectRoles roles : Projects.ProjectRoles.values())
               {
               StringBuilder roleName = new StringBuilder("project_");
               roleName.append(site.getProjectId());
               roleName.append("_");
               roleName.append(roles.name());
               Role role = roleModule.createRole(roleName.toString(), roleName.toString());
               // Now add the site owner to the manager role
               if (roles.equals(Projects.ProjectRoles.MANAGER))
               {
               User user = userModule.findUserByUserName(site.getSiteOwner());
               Set<User> set = new TreeSet<User>();
               set.add(user);
               membershipModule.assignUsers(role, set);
               }
               }