{"record":{"id":"b61f497da8558e8c","repo":"pentaho/pentaho-kettle","slug":"error-inject-property-propname-into-rootclass","errorCode":null,"errorMessage":"Error inject property '<propName>' into <rootClass>","messagePattern":"Error inject property '<propName>' into <rootClass>","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/injection/bean/BeanInjector.java","lineNumber":176,"sourceCode":"      throw new KettleException( \"Property '\" + propName + \"' not found for injection to \" + root.getClass() );\n    }\n\n    String dataName;\n    String dataValue;\n\n    if ( data != null ) {\n      dataName = dataN;\n      dataValue = null;\n    } else {\n      dataName = null;\n      dataValue = dataN;\n    }\n    if ( prop.pathArraysCount == 0 ) {\n      // no arrays in path\n      try {\n        setProperty( root, prop, 0, data != null ? data.get( 0 ) : null, dataName, dataValue );\n      } catch ( Exception ex ) {\n        throw new KettleException( \"Error inject property '\" + propName + \"' into \" + root.getClass(), ex );\n      }\n    } else if ( prop.pathArraysCount == 1 ) {\n      // one array in path\n      try {\n        if ( data != null ) {\n          for ( int i = 0; i < data.size(); i++ ) {\n            setProperty( root, prop, i, data.get( i ), dataName, dataValue );\n          }\n        } else {\n          allocateCollectionField( root, info, propName );\n          for ( int i = 0;; i++ ) {\n            // NOTE: case when constant value is provided and need to fill out all entries with the same value\n            // assumption is the field array/list size allocated to correct size\n            boolean found = setProperty( root, prop, i, null, null, dataValue );\n            if ( !found ) {\n              break;\n            }\n          }","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/injection/bean/BeanInjector.java#L158-L194","documentation":"Wrapping KettleException raised when the underlying setProperty(root, prop, ...) call throws while injecting a value into a property whose injection path has no arrays. The original exception (reflection access, conversion, null handling) is attached as the cause.","triggerScenarios":"Property exists, but setting it failed — e.g. field inaccessible, type conversion from RowMetaAndData value to field type failed, or a getter/setter in the path threw.","commonSituations":"Injecting a String value into a non-String field without convertible format; target object in inconsistent state; plugin field type changed between versions.","solutions":["Read ex.getCause() to find the real reflection/conversion failure","Verify the injected value's type/format matches the field's declared type","Ensure the target step object was fully initialized (fields instantiated) before injection"],"exampleFix":"// before\ninject \"true/false\" text into a boolean[] indexed field\n// after\ninject proper boolean value or convert: \"Y\"/\"N\" per converter spec","handlingStrategy":"try-catch","validationCode":"// pre-check value convertibility\nObject v = data.get(0).getString(\"value\", null);\nObjects.requireNonNull(v, \"Injection source value must not be null\");","typeGuard":null,"tryCatchPattern":"try { injector.setProperty(root, prop, data, n); }\ncatch (KettleException e) { throw new IllegalStateException(\"Set failed on \" + propName + \": \" + e.getCause(), e); }","preventionTips":["Match source field types to the target field type (String vs boolean vs int)","Initialize step metadata objects with defaults() before injecting","Always log getCause() to find the underlying reflection failure"],"tags":["pentaho-kettle","metadata-injection","reflection"],"backgroundTag":"invalid-argument-value","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"}