{"record":{"id":"156871d235ce910a","repo":"pentaho/pentaho-kettle","slug":"simplemappingdialog-exception-notconnectedtorepository","errorCode":null,"errorMessage":"SimpleMappingDialog.Exception.NotConnectedToRepository.Message","messagePattern":"SimpleMappingDialog\\.Exception\\.NotConnectedToRepository\\.Message","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/trans/steps/simplemapping/SimpleMappingDialog.java","lineNumber":427,"sourceCode":"          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() );\n      String fullPath =\n        Const.NVL( path, \"\" ) + \"/\" + Const.NVL( transInf.getName(), \"\" );\n      wPath.setText( fullPath );\n    } catch ( KettleException e ) {\n      new ErrorDialog( shell, BaseMessages.getString(\n        PKG, \"SimpleMappingDialog.Exception.UnableToReferenceObjectId.Title\" ), BaseMessages.getString(\n        PKG, \"SimpleMappingDialog.Exception.UnableToReferenceObjectId.Message\" ), e );\n    }\n  }\n\n  /**\n   * Copy information from the meta-data input to the dialog fields.\n   */","sourceCodeStart":409,"sourceCodeEnd":445,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/trans/steps/simplemapping/SimpleMappingDialog.java#L409-L445","documentation":"getByReferenceData converts a transformation ObjectId reference into a displayable repository path. It requires an active repository connection; when this.repository is null it throws this KettleException (SimpleMappingDialog.Exception.NotConnectedToRepository.Message) instead of dereferencing the repository and failing obscurely.","triggerScenarios":"Opening the Simple Mapping dialog or invoking getData for a mapping specified by reference (by ObjectId) while the transformation is not connected to a repository (e.g. running against local/file metadata).","commonSituations":"Opening a repository-based mapping transformation from a local (no-repo) session; repository login failed or was logged out; transformation migrated to a file-based setup but still holds repository references.","solutions":["Connect to the repository (Repository -> Connect) before opening the mapping dialog","Re-specify the mapping by filename instead of by repository reference","Log in with correct credentials if the session lost its repository connection","Convert the mapping reference to a file path if the transformation is now maintained outside the repository"],"exampleFix":"// before: repository-less session loading repo reference by ObjectId\nif ( repository == null ) { throw new KettleException( ...NotConnectedToRepository... ); }\n// after (caller guard)\nif ( repository != null ) { loadByReference( referenceObjectId ); } else { loadByFilename( mappingFilePath ); }","handlingStrategy":"validation","validationCode":"// Java: require an active repository before resolving references by ObjectId\nif ( repository == null ) throw new IllegalStateException( \"Connect to a repository first\" );","typeGuard":"boolean repoConnected = repository != null && repository.isConnected();","tryCatchPattern":"try { getByReferenceData( objectId ); } catch ( KettleException e ) { promptRepositoryLogin(); }","preventionTips":["Connect to the repository before opening dialogs that resolve repository references","Prefer file-based mapping references when working without a repository","Handle repository logout/timeouts by re-prompting for login"],"tags":["repository","mapping","connection","ui"],"backgroundTag":"authentication-required","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"}