if (data == null) { throw new FinderException("Can't find user "+username); }
    public void setPassword(Admin admin, String username, String password)        throws UserDoesntFullfillEndEntityProfile, AuthorizationDeniedException, FinderException,            RemoteException {        debug(">setPassword(" + username + ", hiddenpwd)");        // Find user        UserDataPK pk = new UserDataPK(username);        UserDataLocal data = home.findByPrimaryKey(pk);        if (globalconfiguration.getEnableEndEntityProfileLimitations()) {            // Check if user fulfills it's profile.            EndEntityProfile profile = raadminsession.getEndEntityProfile(admin,                    data.getEndEntityProfileId());            boolean fullfillsprofile = true;            System.out.println("Set Password" + password);            if (!profile.isModifyable(EndEntityProfile.PASSWORD, 0)) {                if (!password.equals(profile.getValue(EndEntityProfile.PASSWORD, 0))) {                    ;                }                fullfillsprofile = false;            } else if (profile.isRequired(EndEntityProfile.PASSWORD, 0)) {                if ((password == null) || password.trim().equals("")) {                    fullfillsprofile = false;                }            }            if (!fullfillsprofile) {                logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(), username, null,                    LogEntry.EVENT_ERROR_CHANGEDENDENTITY,                    "Password didn't fulfill end entity profile.");                throw new UserDoesntFullfillEndEntityProfile(                    "Password didn't fulfill end entity profile.");            }            // Check if administrator is authorized to edit user.            if (!profileauthproxy.getEndEntityProfileAuthorization(admin,                        data.getEndEntityProfileId(),                        EndEntityProfileAuthorizationProxy.EDIT_RIGHTS, LogEntry.MODULE_RA)) {                logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(), username, null,                    LogEntry.EVENT_ERROR_CHANGEDENDENTITY,                    "Administrator isn't authorized to change password.");                throw new AuthorizationDeniedException("Administrator not authorized to edit user.");            }        }        try {            data.setPassword(password);            data.setTimeModified((new java.util.Date()).getTime());            logsession.log(admin, LogEntry.MODULE_RA, new java.util.Date(), username, null,                LogEntry.EVENT_INFO_CHANGEDENDENTITY, "Password changed.");        } catch (java.security.NoSuchAlgorithmException nsae) {            debug("NoSuchAlgorithmException while setting password for user " + username);            throw new EJBException(nsae);        }        debug("<setPassword(" + username + ", hiddenpwd)");    }