Solved
LoginService
session = repository.loginService("SystemUserMysite", repository.getDefaultWorkspace());
This line throwing an exception as Can neither derive user name nor principal names for bundle
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.