DirectoryManagerServiceClient updateLocalUser Error

Avatar

Avatar

PMorales

Avatar

PMorales

PMorales

19-08-2014

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.

View Entire Topic

Avatar

Avatar

amaini

Employee

Avatar

amaini

Employee

amaini
Employee

21-08-2014

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.