Java 创建用户和组成员身份时发生Camunda数据库错误

Java 创建用户和组成员身份时发生Camunda数据库错误,java,database,mybatis,camunda,Java,Database,Mybatis,Camunda,在从RESTAPI中的头文件获取后,我正在尝试添加用户ID并向进程引擎添加组 用于创建用户和组成员身份的代码 private void setGroupMembership(String userId, IdentityService identityService) throws Exception{ /* When uncommented: Exception: User already exist User user = identityService.n

在从RESTAPI中的头文件获取后,我正在尝试添加用户ID并向进程引擎添加组

用于创建用户和组成员身份的代码

private void setGroupMembership(String userId, IdentityService identityService) throws Exception{

        /* When uncommented: Exception: User already exist
        User user = identityService.newUser(userId);
        identityService.saveUser(user);
        */

        if (groupIds.isEmpty()) {
            throw new Exception("Group Id is null");
        }

        for (String groupId: groupIds) {
 

            /* When uncommented: Exception: Group already exist
            Group group = identityService.newGroup(groupId);
            identityService.saveGroup(group);
            */

            // create membership
            identityService.createMembership(userId, groupId);
        }

    }
当我尝试打开Camunda Webapp时,出现以下错误

org.camunda.bpm.engine.ProcessEngineException: ENGINE-03083 Unexpected exception while executing database operations with message '
### Error updating database.  Cause: java.lang.NullPointerException
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.MembershipRelation.insertMembership-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_ID_MEMBERSHIP (USER_ID_, GROUP_ID_)     values (       ?,       ?     )
### Cause: java.lang.NullPointerException