AnsweredAssumed Answered

Injecting UserService yields Null

Question asked by abbask on May 9, 2016
Latest reply on May 9, 2016 by abbask

i am trying to inject UserService but it throws NullPointerException when i try to use it.

public class CreateUser implements JavaDelegate{
   private static final Logger LOG = LoggerFactory.getLogger(CreateUser.class);
   //inject user service and group service
   private UserService userService;
   private GroupService groupService;
   public void execute(DelegateExecution execution) throws Exception {
      //get process variables
      String userName = (String) execution.getVariable("userName");
      String userEmail = (String) execution.getVariable("userEmail");
      Long userId = (Long) execution.getVariable("userId");
      System.out.println(userService + "<<<>>>" + groupService); + " is userService object");
      //create new user
      User user = userService.createNewUser(userEmail, userName, "", userId.toString(), "TCS", UserStatus.ACTIVE, AccountType.ENTERPRISE, userId);;

gives null pointer exception at userService.createNewUser(..)

thanks in advance