Expand my Community achievements bar.

SOLVED

DirectoryManagerServiceClient updateLocalUser Error

Avatar

Level 1

ALC Version: ALC ES2.5

The class DirectoryManager has a method called uploadLocalUser. I created a DSC in java and deployed into ALC. There were no error or warnings.

The class is defined here:

http://help.adobe.com/en_US/livecycle/11.0/ProgramLC/javadoc/com/adobe/idp/um/api/DirectoryManager.h..., java.lang.String, java.lang.String)

The method is defined this way:

void updateLocalUser(User updatedUser,
                     java.lang.String oldPassword,
                     java.lang.String newPassword)
                     throws UMException

This is the code I'm using:

public boolean ChangePassword(java.lang.String userOID,java.lang.String oldPassword,java.lang.String newPassword){

try

{

ServiceClientFactory myFactory = ServiceClientFactory.createInstance();

DirectoryManagerServiceClient dmClient = new DirectoryManagerServiceClient(myFactory);

PrincipalSearchFilter psf = new PrincipalSearchFilter();

psf.setPrincipalOid(userOID);

List<User> principalList = dmClient.findPrincipals(psf);

Iterator<User> pit = principalList.iterator();

if(pit.hasNext()){

User theUser = pit.next();

dmClient.updateLocalUser(theUser,oldPassword,newPassword);

return true;

}

return false;

}

catch(Exception e)

{

e.printStackTrace();

return false;

}

}

When executed, the code gives the following error:

2014-08-18 17:55:38,973 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManager.updateLocalUser(com.adobe.idp.um.api.infomodel.impl.UserImpl,java.lang.String) throws com.adobe.idp.common.errors.exception.IDPException,com.adobe.idp.common.errors.exception.IDPSystemException, causedBy:

  1. com.adobe.idp.common.errors.exception.IDPSystemExceptionorigin: com.adobe.idp.common.errors.exception.IDPException| [com.adobe.idp.um.businesslogic.directoryservices.DirectoryServicesManagerBean] errorCode:13322 errorCodeHEX:0x340a message:54170b06-1dd211b2-801ae11d-8c761708

Can you tell us where is the problem with this API function? is it the code?...

Thank you very much.

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi , please  also try with "userID"

psf.setUserId("myLCUser");

List<User> principalList = dirClient.findPrincipals(psf);

            Iterator<User> pit = principalList.iterator();

            User testUser = null;

            if (pit.hasNext())

            {

            testUser = pit.next();

            }

             dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");

This works fine for me and I can change the password. I am able to do same using psf.setPrincipalOid(userOID); but in here, the value I used is "ID" of the user, not "userId".

In userOID case, if you try debugging and confirming the value of userOID , which you must be retrieving at some earlier step. I hope that helps. 

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

Hi , please  also try with "userID"

psf.setUserId("myLCUser");

List<User> principalList = dirClient.findPrincipals(psf);

            Iterator<User> pit = principalList.iterator();

            User testUser = null;

            if (pit.hasNext())

            {

            testUser = pit.next();

            }

             dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");

This works fine for me and I can change the password. I am able to do same using psf.setPrincipalOid(userOID); but in here, the value I used is "ID" of the user, not "userId".

In userOID case, if you try debugging and confirming the value of userOID , which you must be retrieving at some earlier step. I hope that helps. 

Avatar

Level 1

Hi,

Finding the user was not the problem. I can find the user using OID and userID.

The line that give me the exception was:

dirClient.updateLocalUser(testUser, "oldPassword", "newPassword");


Maybe the ALC version I have has a bug...

I will keep trying...



thanks,



Avatar

Level 1

I try with another user and my original code worked.... so... aparently the account had problems...