cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of user failed, now it is a zombie...

Former Member
0 Kudos

Hi,

we have a portalservice, which is creating users with the following code:

IUserAccountFactory userAccountFactory = UMFactory.getUserAccountFactory();

userAccount = userAccountFactory.newUserAccount(logonId, uniqueUserId);

When we try to create users with unique names with a length which does not satisfy the required minimum length of user-id (customizable in the UM configuration), the above code raises an UMException with message LOGONID_TOO_SHORT. Everything fine up this point.

What is amazing now: After changing the minimum length we tried to create this user (lets say 'xyz') again, but we get the message "user with unique name 'xyz' already exits". Whereas searching for user 'xyz' returns "user not found"!

Is this a bug? Or is there a possibility to unlock these "zombies"?

Thanks and regards

Jan

Accepted Solutions (1)

Accepted Solutions (1)

Saravanan_SD
Advisor
Advisor
0 Kudos

Hi Jan,

Once an exceptions occurs,you must delete the user and then try to create a new user.

User can be deleted by:

IUserfactory userfact = UMFactory.getUserFactory();
IUser user = userFact.getUserByLoginID(userid);
string uniqueid= user.getUniqueID();
userfact.deleteUser(uniquedid);

And make sure you are issuing commit() inorder to actually create the user.

Regards,

Saravanan

Former Member
0 Kudos

Hi Saravanan,

deleting the user does not work, because userFact.getUserByLoginID(userid) does not return a user (UMException, unknow logon-id).

As I said this user is somehow a "zombie", searching for it returns "user not known", whereas trying to create it returns "user already exists"...

Any ideas?

Thanks and regards

jan

Former Member
0 Kudos

Ok, the problem was: I first created the User and based on that User I tried to create the UserAccount. Creating the User was fine, but creating the account failed (due to a logon-id which was too short).

A User without an account can not be found inside the portal, it is only an internal instance of the UME, but without an account it does not have an external representation. But it still exists and therefore can not be created again.

So I solved the problem by deleting the user like this:

IUserFactory userFactoryEP6 = UMFactory.getUserFactory();
IUser userEP6 = userFactoryEP6.getUserByUniqueName(uniqueName);

String uid = userEP6.getUniqueID();
userFactoryEP6.deleteUser(uid);

I also rewrote my Exception-handling in the createUser-coding: If creation an account fails, I delete the user I created right before. This ensures, that no "zombie"-users are left behind.

regards

Jan

Answers (0)