cancel
Showing results for 
Search instead for 
Did you mean: 

com.sap.security.api.UMRuntimeException

Former Member
0 Kudos

Hi All,

I try to develop a WDJ application for changing password. I`m using com.sap.security.api jar file. When i deploy my application am getting error as follows. pls help me out..

com.sap.security.api.UMRuntimeException: Maint method setAttribute cannot be used because the principal is not mutable!

at com.sap.security.core.imp.AbstractPrincipal.setAttributeValues(AbstractPrincipal.java:2019)

at com.sap.security.core.imp.AbstractPrincipal.setAttributeValues(AbstractPrincipal.java:2006)

at com.sap.security.core.imp.AbstractUserAccount.setPassword(AbstractUserAccount.java:1592)

at com.sap.security.core.imp.UserAccountWrapper.setPassword(UserAccountWrapper.java:376)

at com.sap.demo.passwordreset.passwordcomp.PasswordCompView.resetPassword(PasswordCompView.java:235)

at com.sap.demo.passwordreset.passwordcomp.PasswordCompView.onActionSubmit(PasswordCompView.java:315)

at com.sap.demo.passwordreset.passwordcomp.wdp.InternalPasswordCompView.wdInvokeEventHandler(InternalPasswordCompView.java:157)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:131)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:72)

at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.doHandleActionEvent(ProcessingEventPhase.java:156)

at com.sap.tc.webdynpro.clientserver.phases.ProcessingEventPhase.execute(ProcessingEventPhase.java:91)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequestPartly(WindowPhaseModel.java:162)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doProcessRequest(WindowPhaseModel.java:110)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:97)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:514)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:52)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doExecute(ClientApplication.java:1547)

at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.doProcessing(ClientApplication.java:1361)

at

Thanks,

Arun.

Accepted Solutions (1)

Accepted Solutions (1)

former_member187564
Participant
0 Kudos

Hi Arun,

This message is coming due mutUserAcct

IUserAccount mutUserAcct = UMFactory.getUserAccountFactory().getMutableUserAccount(userAcct.getUniqueID());

Just copy & paste following code :

try

{

IUserAccount userAccount =UMFactory.getUserAccountFactory().getUserAccountByLogonId(userId);

UserAccount mutUserAccount = UMFactory.getUserAccountFactory().getMutableUserAccount(userAccount.getUniqueID());

isValidPassword = mutUserAccount.checkPassword(oldPassword);

if(isValidPassword)

{

// userAccount.setPassword(newPassword);

// userAccount.commit();

mutUserAccount.setPassword (oldPassword,newPassword);

mutUserAccount.setPasswordChangeRequired(false);

mutUserAccount.save();

mutUserAccount.commit();

wdComponentAPI.getMessageManager().reportSuccess("Your Password has benn changed Now");

wdContext.currentContextElement().setNewPassword("");

wdContext.currentContextElement().setConfirnNewPassword("");

wdContext.currentContextElement().setOldPassword("");

}

Regards

Vijay siwach

Former Member
0 Kudos

Problem solved before itself. Anyway thanks.

Regards,

Arun.

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

you have to get mutable user to do the update

IUserFactory.getMutableUser

Former Member
0 Kudos

HI John,

Am using the following code, still am getting the err...pls suggest

IUserAccount userAcct = UMFactory.getUserAccountFactory().getUserAccountByLogonId(userId);

* *

IUserAccount mutUserAcct = UMFactory.getUserAccountFactory().getMutableUserAccount(userAcct.getUniqueID());

Thanks,

Arun V G

Former Member
0 Kudos

John Can you help on this..?

Thanks,

Arun