{"record":{"id":"66b424f8555d34ea","repo":"pentaho/pentaho-kettle","slug":"jobtrans-exception-referencedtransformationidisnull","errorCode":null,"errorMessage":"JobTrans.Exception.ReferencedTransformationIdIsNull","messagePattern":"JobTrans\\.Exception\\.ReferencedTransformationIdIsNull","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/base/MetaFileLoaderImpl.java","lineNumber":244,"sourceCode":"            if ( theMeta == null ) {\n              if ( isTransMeta() ) {\n                theMeta = rep == null\n                  ? (T) new TransMeta( bowl, metaPath, metaStore, null, true, jobEntryBase.getParentVariableSpace(),\n                                       null )\n                  : getMetaFromRepository( bowl, rep, r, metaPath, tmpSpace );\n              } else {\n                theMeta = getMetaFromRepository( bowl, rep, r, metaPath, tmpSpace );\n              }\n              if ( theMeta != null ) {\n                idContainer[ 0 ] = metaPath;\n              }\n            }\n          }\n          break;\n        case REPOSITORY_BY_REFERENCE:\n          if ( metaObjectId == null ) {\n            if ( isTransMeta() ) {\n              throw new KettleException( BaseMessages.getString( persistentClass,\n                \"JobTrans.Exception.ReferencedTransformationIdIsNull\" ) );\n            } else {\n              throw new KettleException( BaseMessages.getString( persistentClass,\n                \"JobJob.Exception.ReferencedTransformationIdIsNull\" ) );\n            }\n          }\n\n          if ( rep != null ) {\n            theMeta = attemptCacheRead( metaObjectId.toString() ); //try to get from the cache first\n            if ( theMeta == null ) {\n              // Load the last revision\n              if ( isTransMeta() ) {\n                theMeta = (T) rep.loadTransformation( metaObjectId, null );\n              } else {\n                theMeta = (T) rep.loadJob( metaObjectId, null );\n              }\n              idContainer[ 0 ] = metaObjectId.toString();\n            }","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/base/MetaFileLoaderImpl.java#L226-L262","documentation":"A job/trans job-entry is configured to locate its referenced object by repository object ID (specificationMethod = REPOSITORY_BY_REFERENCE), but that ID (metaObjectId) is null. The loader validates this in getMetaForEntry before attempting any repository load and throws a KettleException immediately. The message key differs by entry type: 'JobTrans...' for transformation entries and 'JobJob...' for job entries.","triggerScenarios":"Calling getMetaForEntry (directly or via JobEntryTrans.jobMeta()/JobEntryJob.jobMeta()) when the entry's specificationMethod is REPOSITORY_BY_REFERENCE and setMetaObjectId()/the repository reference ObjectId was never set, was lost during serialization/import, or the entry was constructed programmatically without specifying an object ID.","commonSituations":"Building job entries in code or via a plugin without calling setObjectId; metadata imported/migrated between repositories where object IDs were not remapped; a corrupted or hand-edited job XML/kjb file whose reference node lacks an id; repository references that were valid in one repo but are meaningless (null) in another.","solutions":["Set the repository object ID on the entry before running: call entry.setSpecificationMethod(SPECIFICATION_METHOD.REPOSITORY_BY_REFERENCE) and entry.setObjectId(repositoryObjectId) with a valid ObjectId obtained from the repository.","If the object should be referenced by name instead, switch the entry to REPOSITORY_BY_NAME and set directory + name (or to FILENAME with a file path).","Open the job in Spoon and re-select the referenced transformation/job on the job entry dialog so the object ID is repopulated, then save.","Verify the kjb file/repo metadata actually contains the reference ID element; if missing, recreate or re-export the job."],"exampleFix":"// before\nJobEntryTrans jet = new JobEntryTrans();\njet.setSpecificationMethod( JobEntryInterface.SPECIFICATION_METHOD.REPOSITORY_BY_REFERENCE );\n// objectId never set -> KettleException at runtime\n\n// after\njet.setSpecificationMethod( JobEntryInterface.SPECIFICATION_METHOD.REPOSITORY_BY_REFERENCE );\nRepositoryObject ros = rep.getObjectInformation( objectId, RepositoryObjectType.TRANSFORMATION );\njet.setObjectId( ros.getObjectId() ); // valid, non-null ObjectId","handlingStrategy":"validation","validationCode":"// before executing the job\nif ( jobEntry.getSpecificationMethod() == SPECIFICATION_METHOD.REPOSITORY_BY_REFERENCE\n     && jobEntry.getObjectId() == null ) {\n  throw new IllegalStateException(\n    \"Entry '\" + jobEntry.getName() + \"' uses REPOSITORY_BY_REFERENCE but has no object ID\" );\n}","typeGuard":"boolean isByReferenceWithId( JobEntryInterface e ) {\n  return e.getSpecificationMethod() == SPECIFICATION_METHOD.REPOSITORY_BY_REFERENCE\n    && e.getObjectId() != null;\n}","tryCatchPattern":"try {\n  meta = loader.getMetaForEntry( bowl, rep, metaStore, space );\n} catch ( KettleException ke ) {\n  if ( String.valueOf( ke.getMessage() ).contains( \"ReferencedTransformationIdIsNull\" ) ) {\n    throw new JobExecutionException( \"Job entry reference has no repository object ID; re-select it in Spoon\", ke );\n  }\n  throw ke;\n}","preventionTips":["Always set both specificationMethod and objectId when constructing job entries programmatically.","After repository migrations, run an audit that resolves every by-reference entry's ObjectId in the target repo.","Prefer REPOSITORY_BY_NAME when referencing across repositories so IDs are not required.","Re-save jobs in Spoon after copy/paste between jobs to verify references are intact."],"tags":["kettle","job-entry","repository","null-reference","configuration"],"backgroundTag":"null-argument","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"}