cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ASM SessionService returns null for myAccount

lohith123
Explorer
0 Likes
295

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

Accepted Solutions (0)

Answers (0)