{"record":{"id":"110b669a660fa3f1","repo":"pentaho/pentaho-kettle","slug":"repositorylockcontroller-error-0001-unable-to-initial","errorCode":"RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE","errorMessage":"Unable to initialize repository service [ {0} ]","messagePattern":"Unable to initialize repository service \\[ (.+?) \\]","errorType":"error_code","errorClass":"ControllerInitializationException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/controller/RepositoryLockController.java","lineNumber":97,"sourceCode":"\n    @Override\n    public Enumeration<String> getKeys() {\n      return null;\n    }\n\n    @Override\n    protected Object handleGetObject( String key ) {\n      return BaseMessages.getString( PKG, key );\n    }\n  };\n\n  public void init( Repository rep ) throws ControllerInitializationException {\n    try {\n      if ( rep != null && rep.hasService( ILockService.class ) ) {\n        repository = rep;\n        service = (ILockService) rep.getService( ILockService.class );\n      } else {\n        throw new ControllerInitializationException( BaseMessages.getString( PKG,\n            \"RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE\", ILockService.class ) ); //$NON-NLS-1$\n\n      }\n\n      bindingFactory = new DefaultBindingFactory();\n      bindingFactory.setDocument( getXulDomContainer().getDocumentRoot() );\n\n      XulEventHandler eventHandler = getXulDomContainer().getEventHandler( \"browseController\" ); //$NON-NLS-1$\n\n      if ( eventHandler instanceof BrowseController ) {\n        browseController = (BrowseController) eventHandler;\n      }\n\n      // Disable row dragging if it is locked and the user does not have permissions\n      fileTable = (XulTree) getXulDomContainer().getDocumentRoot().getElementById( \"file-table\" ); //$NON-NLS-1$\n      folderTree = (XulTree) document.getElementById( \"folder-tree\" ); //$NON-NLS-1$\n      lockFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( \"file-context-lock\" ); //$NON-NLS-1$\n      deleteFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById( \"file-context-delete\" ); //$NON-NLS-1$","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/controller/RepositoryLockController.java#L79-L115","documentation":"RepositoryLockController.init requires the repository to expose an ILockService. If the repository is null or hasService(ILockService.class) is false, it throws ControllerInitializationException with ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE, since lock management cannot work without the service.","triggerScenarios":"Calling init(rep) on a repository lacking the lock service (no ILockService), or passing null — e.g. non-EE repositories that don't implement lock services.","commonSituations":"Initializing the lock tab/controllers against a database or file repository instead of a Pentaho EE repository; repository connection incomplete when the explorer initializes controllers; EE plugin version mismatch removing the lock service.","solutions":["Initialize only against a repository providing ILockService (rep.hasService(ILockService.class))","Guard init: check the service exists and skip/disable lock UI otherwise","Catch ControllerInitializationException around RepositoryLockController.init and continue without the lock feature","Verify the Pentaho EE repository plugin is properly installed and the user is connected"],"exampleFix":"// before\nlockController.init( rep );\n// after\nif ( rep != null && rep.hasService( ILockService.class ) ) {\n  lockController.init( rep );\n}","handlingStrategy":"try-catch","validationCode":"if (rep != null && rep.hasService(ILockService.class)) { lockController.init(rep); }\n","typeGuard":"static boolean hasLockService(Repository rep) {\n  return rep != null && rep.hasService(ILockService.class);\n}\n","tryCatchPattern":"try {\n  lockController.init(rep);\n} catch (ControllerInitializationException e) {\n  log.warn(\"Lock service unavailable; lock UI disabled\", e);\n  // hide lock-related controls\n}\n","preventionTips":["Verify ILockService availability before wiring the lock controller","Only initialize lock UI on Pentaho EE repositories","Catch ControllerInitializationException so one unsupported feature doesn't break the explorer"],"tags":["pentaho","repository","locks","controller-init"],"backgroundTag":"feature-not-enabled","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}