pentaho/pentaho-kettle · error · IllegalArgumentException

JobEntryBase must be a JobEntryTrans or JobEntryJob object

Error message

JobEntryBase must be a JobEntryTrans or JobEntryJob object

What it means

The MetaFileLoaderImpl constructor accepts a JobEntryBase that must be either a JobEntryTrans (mapping to TransMeta) or a JobEntryJob (mapping to JobMeta). Any other JobEntryBase subtype reaches the else branch and throws IllegalArgumentException 'JobEntryBase must be a JobEntryTrans or JobEntryJob object'.

Solutions

  1. Ensure only JobEntryTrans or JobEntryJob instances are passed to this constructor; filter or branch on instanceof before constructing.
  2. Use the step-meta constructor variant (BaseStepMeta / StepWithMappingMeta / JobExecutorMeta) for step-level entries instead.
  3. Inspect the object's actual class in the log and route it to the appropriate loader.
  4. If a custom entry needs file-based loading, extend MetaFileLoader rather than reusing this constructor.

Example fix

// before
MetaFileLoaderImpl loader = new MetaFileLoaderImpl( someJobEntry, ... ); // throws for other entry types
// after
if ( someJobEntry instanceof JobEntryTrans || someJobEntry instanceof JobEntryJob ) {
  MetaFileLoaderImpl loader = new MetaFileLoaderImpl( someJobEntry, ... );
}
Defensive patterns

Strategy: type-guard

Validate before calling

if ( !( entry instanceof JobEntryTrans ) && !( entry instanceof JobEntryJob ) ) {
  throw new IllegalArgumentException( "Unsupported entry type: " + entry.getClass().getName() );
}

Type guard

boolean isFileLoaderCompatible( JobEntryBase entry ) {
  return entry instanceof JobEntryTrans || entry instanceof JobEntryJob;
}

Try / catch

try {
  MetaFileLoaderImpl l = new MetaFileLoaderImpl( entry, ... );
} catch ( IllegalArgumentException e ) {
  log.error( "Entry not supported by MetaFileLoaderImpl: " + entry.getClass().getName() );
}

Prevention

When it happens

Trigger: Constructing MetaFileLoaderImpl with a job entry that is neither JobEntryTrans nor JobEntryJob — e.g. a custom job entry, or passing a step meta object into the job-entry constructor variant.

Common situations: Custom plugins or mapping-executor code that builds a MetaFileLoader for arbitrary job entries; refactors that changed which entry type is passed; generic code iterating job entries and assuming all are Trans/Job entries.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/base/MetaFileLoaderImpl.java:108

      this.filename = jobEntryBase.getFilename();
      //collect fields from the super classes
      if ( jobEntryBase instanceof JobEntryTrans ) {
        JobEntryTrans jobEntryTrans = (JobEntryTrans) jobEntryBase;
        this.metaName = jobEntryTrans.getTransname();
        this.directory = jobEntryTrans.getDirectory();
        this.metaObjectId = jobEntryTrans.getTransObjectId();
        this.friendlyMetaType = "Transformation";
        this.persistentClass = TransMeta.class;
      } else {
        JobEntryJob jobEntryJob = (JobEntryJob) jobEntryBase;
        this.metaName = jobEntryJob.getJobName();
        this.directory = jobEntryJob.getDirectory();
        this.metaObjectId = jobEntryJob.getJobObjectId();
        this.friendlyMetaType = "Job";
        this.persistentClass = JobMeta.class;
      }
    } else {
      throw new IllegalArgumentException( "JobEntryBase must be a JobEntryTrans or JobEntryJob object" );
    }
    useCache = "Y".equalsIgnoreCase( System.getProperty( Const.KETTLE_USE_META_FILE_CACHE, Const.KETTLE_USE_META_FILE_CACHE_DEFAULT ) );
  }

  /**
   * @param baseStepMeta        either a StepWithMappingMeta or JobExecutorMeta Object (BaseStepMeta is a shared
   *                            subclass )
   * @param specificationMethod
   */
  public MetaFileLoaderImpl( BaseStepMeta baseStepMeta, ObjectLocationSpecificationMethod specificationMethod ) {
    //Constructor adapting supported Steps
    if ( baseStepMeta instanceof StepWithMappingMeta || baseStepMeta instanceof JobExecutorMeta ) {
      this.baseStepMeta = baseStepMeta;
      this.specificationMethod = specificationMethod;
      //collect fields from the super classes
      if ( baseStepMeta instanceof StepWithMappingMeta ) {
        StepWithMappingMeta stepWithMappingMeta = (StepWithMappingMeta) baseStepMeta;
        this.metaName = stepWithMappingMeta.getTransName();

View on GitHub (pinned to f3058517a1)