{"record":{"id":"c38d3c51d3923247","repo":"pentaho/pentaho-kettle","slug":"simplemappingdialog-exception","errorCode":null,"errorMessage":"SimpleMappingDialog.Exception.UnableToFindRepositoryDirectory","messagePattern":"SimpleMappingDialog\\.Exception\\.UnableToFindRepositoryDirectory","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/trans/steps/simplemapping/SimpleMappingDialog.java","lineNumber":414,"sourceCode":"          filename = filename.replace( \".ktr\", \"\" );\n          wPath.setText( filename );\n        }\n        String transPath = transMeta.environmentSubstitute( filename );\n        String realTransname = transPath;\n        String realDirectory = \"\";\n        int index = transPath.lastIndexOf( \"/\" );\n        if ( index != -1 ) {\n          realTransname = transPath.substring( index + 1 );\n          realDirectory = transPath.substring( 0, index );\n        }\n\n        if ( Utils.isEmpty( realDirectory ) || Utils.isEmpty( realTransname ) ) {\n          throw new KettleException(\n            BaseMessages.getString( PKG, \"SimpleMappingDialog.Exception.NoValidMappingDetailsFound\" ) );\n        }\n        RepositoryDirectoryInterface repdir = repository.findDirectory( realDirectory );\n        if ( repdir == null ) {\n          throw new KettleException( BaseMessages.getString(\n            PKG, \"SimpleMappingDialog.Exception.UnableToFindRepositoryDirectory\" ) );\n        }\n        loadRepositoryTrans( realTransname, repdir );\n        break;\n      default:\n        break;\n    }\n  }\n\n  private void getByReferenceData( ObjectId transObjectId ) {\n    try {\n      if ( repository == null ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"SimpleMappingDialog.Exception.NotConnectedToRepository.Message\" ) );\n      }\n      RepositoryObject transInf = repository.getObjectInformation( transObjectId, RepositoryObjectType.TRANSFORMATION );\n      String path = DialogUtils\n        .getPath( transMeta.getRepositoryDirectory().getPath(), transInf.getRepositoryDirectory().getPath() );","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/trans/steps/simplemapping/SimpleMappingDialog.java#L396-L432","documentation":"SimpleMappingDialog.loadTransformation resolves the directory portion of the mapping path via repository.findDirectory(realDirectory). When the repository has no directory at that path it returns null and this KettleException (SimpleMappingDialog.Exception.UnableToFindRepositoryDirectory) is thrown, meaning the referenced mapping's folder does not exist in the connected repository.","triggerScenarios":"Loading mapping metadata by name from a repository where the directory string parsed from transPath (everything before the last '/') does not match any repository directory.","commonSituations":"Mappings moved or renamed after being referenced; connecting to a different repository than the one where the mapping was designed; case-sensitivity or slash/separator differences across OS; deleted directories.","solutions":["Browse the repository and reselect the mapping in the Simple Mapping dialog so the path is regenerated","Verify the directory exists in the connected repository (Repository explorer)","Confirm you are connected to the correct repository (dev vs prod)","Restore/recreate the missing directory, or update the mapping reference to the new path"],"exampleFix":"// before: stale path after directory rename\nString transPath = \"/old-dir/my-mapping\"; // /old-dir deleted -> findDirectory returns null\n// after\nString transPath = \"/new-dir/my-mapping\"; // reselect mapping after moving it","handlingStrategy":"validation","validationCode":"// Java: check directory exists before loading mapping by name\nRepositoryDirectoryInterface dir = repository.findDirectory( realDirectory );\nif ( dir == null ) throw new IllegalStateException( \"Mapping directory missing: \" + realDirectory );","typeGuard":"boolean dirExists = realDirectory != null && repository.findDirectory( realDirectory ) != null;","tryCatchPattern":"try { loadMapping( path ); } catch ( KettleException e ) { showRepositoryBrowserToReselect(); }","preventionTips":["Verify the path in Repository explorer after any directory reorganization","Connect to the same repository the mapping was designed in","Use repository search to relocate mappings instead of keeping stale paths"],"tags":["repository","mapping","directory-not-found","ui"],"backgroundTag":"directory-not-found","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"}