on 03-22-2011 5:38 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you have to get mutable user to do the update
IUserFactory.getMutableUser
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.