on 2019 Feb 24 3:57 PM
Hi All, After logging to ASM module using - ASMAgent credentials and then loaded a Profile , after i started the session and navigated to My-Account page getting NullpointerException. This is because unable to set sessionService. I've used sessionservice.getattribute("XYZ"); Even though i have setter and getter methods with proper injection. Also It is creating 2 sessionservices one with some value and one with null. below is the code where i am getting null.
final UserProfileModel currentUserProfile = getSessionService().getAttribute(CoreConstants.SESSION_CURRENT_USER_PROFILE);
Even though while authenticating i am overriding onAuthenticationSuccess method and setting the user profile in sessionservice. Below is the code for setting userprofile in sessionservice. kindly help me on this.
final UserModel currentUser = userModel;
final Collection UserProfiles = currentUser.getProfile();
UserProfileModel currentUserProfile= null;
if (!UserProfiles.isEmpty())
{
currentUserProfile = UserProfiles.iterator().next();
sessionService.setAttribute(CoreConstants.SESSION_CURRENT_USER_PROFILE,currentUserProfile); }
Thanks, Lohith
Request clarification before answering.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.