Search code examples
javaconfluence

unable to create user in confluence 3.5


I am developing my cutom authenticator in java to authenticate intranet users to login to confluence instead of asking them login. I have built my authenticator and it is working for the existing users. But, if I am trying to add a new user to the database, it is giving below message in the logs and keep on trying for that.

getUser $Proxy31 cannot be cast to com.atlassian.confluence.user.DefaultUserAccessor

my code looks like below.

try {
    log.warn("inside try block of creating users");
    DefaultUserAccessor userAccessor = (DefaultUserAccessor) ContainerManager.getInstance().getContainerContext().getComponent("userAccessor");
    String[] defaultGroup = { "confluence-users" };
    User newUser = userAccessor.addUser(sapUserId, password,email, fullname, defaultGroup);
} 
catch (Exception e) {
 log.error(e.getMessage());
}

I googled for $prime31, but haven't got much info on this. Can you please help me to identify whats the issue in creating user.

Thanks.


Solution

  • This started working after I did a bounce to the server. I haven't got this proxy31 message in logs after that and users are added to the tables in db and are authenticated.