pentaho/pentaho-kettle · error · IllegalStateException

There is no selected user or role.

Error message

There is no selected user or role.

What it means

updatePermission reads the currently selected user/role from the UI list; if nothing is selected (getSelectedItem() returns null) it throws IllegalStateException('There is no selected user or role.'). It guards against updating ACL permissions without a target recipient.

Solutions

  1. Select a user or role in the recipient list before toggling permission checkboxes
  2. Guard updatePermission: only process when userRoleList.getSelectedItem() != null
  3. Ensure the XUL selection binding populates a default selected item when the dialog opens

Example fix

// before
public void updatePermission() {
  UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();
  if ( acl == null ) {
    throw new IllegalStateException( ... );
  }
// after
public void updatePermission() {
  UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();
  if ( acl == null ) {
    return; // nothing selected; nothing to update
  }
Defensive patterns

Strategy: type-guard

Validate before calling

if (userRoleList.getSelectedItem() != null) { updatePermission(); }

Type guard

static boolean hasSelectedRecipient(org.pentaho.ui.xul.components.XulListBox list) {
  return list.getSelectedItem() != null;
}

Try / catch

try {
  updatePermission();
} catch (IllegalStateException e) {
  log.warn("No user/role selected; ignoring checkbox change");
}

Prevention

When it happens

Trigger: Checking/unchecking a permission checkbox in the permissions dialog when the user/role selection list has no selection (e.g. list empty, selection cleared programmatically, or UI event fires before a recipient is chosen).

Common situations: Clicking permission checkboxes immediately after opening the dialog before picking a user or role; bindings not yet populated so no item is selected; custom XUL changes removing default selection.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/2ae24667ece8042d. Report an issue: GitHub.

Appendix: source

Thrown at plugins/pur/core/src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/controller/AbstractPermissionsController.java:478

    }
    return false;
  }

  private void clearSelectedObjAcl() {
    Object ro = getSelectedObjects().get( 0 );
    if ( ro instanceof IAclObject ) {
      ( (IAclObject) ro ).clearAcl();
    }
  }

  /*
   * updatePermission method is called when the user checks or uncheck any permission checkbox. This method updates the
   * current model with the update value from the UI
   */
  public void updatePermission() {
    UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();
    if ( acl == null ) {
      throw new IllegalStateException( BaseMessages.getString( PKG, "PermissionsController.NoSelectedRecipient" ) );
    }
    acl.setPermissionSet( permissionsCheckboxHandler.processCheckboxes() );
    clearSelectedObjAcl();
    viewAclsModel.updateAcl( acl );
  }

  /*
   * (non-Javadoc)
   * 
   * @see org.pentaho.di.ui.repository.repositoryexplorer.ContextChangeListener#onContextChange() This method is called
   * whenever user change the folder or file selection
   */
  protected TYPE returnType;

  public TYPE onContextChange() {
    try {
      if ( viewAclsModel.isModelDirty() ) {

View on GitHub (pinned to f3058517a1)