org.pentaho.di.core.exception.KettleValueException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • GitHub comment 34#194014252
    via GitHub by levyj
    ,
  • Base transaction does a mapping to a sub-transaction. In a java script in the subtransaction is a boolean variable declared and exported as field. This field is returned to the calling transaction through mapping (output). In a java script in the calling transaction the value of the boolean is changed. You get the following error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unexpected error 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Javascript error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Javascript error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.mozilla.javascript.NativeBoolean cannot be cast to java.lang.Boolean 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:457) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:688) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at java.lang.Thread.run(Thread.java:662) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Caused by: org.pentaho.di.core.exception.KettleValueException:
    via by Thomas Bednarz,
  • As part of a PDI Job, a variable is declared in the parent job based upon the value in a Timestamp field. In a later transformation, the "Get Variables" step is used to cast the variable back into a Timestamp field. This causes an error to be thrown saying that PDI cannot convert the value to "data type 9", even though it just converted the Timestamp to a String earlier in the job. {noformat} 2015/05/06 13:29:02 - Get Variables.0 - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : Unexpected error 2015/05/06 13:29:02 - Get Variables.0 - ERROR (version 5.3.0.0-213, build 1 from 2015-02-02_12-17-08 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 2015/05/06 13:29:02 - Get Variables.0 - max_date Timestamp : I can't convert the specified value to data type : 9 2015/05/06 13:29:02 - Get Variables.0 - 2015/05/06 13:29:02 - Get Variables.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertData(ValueMetaBase.java:3547) 2015/05/06 13:29:02 - Get Variables.0 - at org.pentaho.di.trans.steps.getvariable.GetVariable.processRow(GetVariable.java:108) 2015/05/06 13:29:02 - Get Variables.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2015/05/06 13:29:02 - Get Variables.0 - at java.lang.Thread.run(Thread.java:745) {noformat} In looking at [ValueMetaBase.convertData(...)|https://github.com/pentaho/pentaho-kettle/blob/master/core/src/org/pentaho/di/core/row/value/ValueMetaBase.java#L3537-L3558], this appears to be due to a missing switch statement for the Timestamp type. At a higher level, "Get Variables" uses the {{ValueMeta()}} class, instead of using {{ValueMetaFactory}}, which would have returned the correct {{ValueMetaTimestamp}} object, which has an override method that would have properly handled the conversion from String to Timestamp. Example patch for "Get Variables" step. {code:title=GetVariableMeta.java} - ValueMetaInterface v = new ValueMeta( fieldName[i], fieldType[i] ); + ValueMetaInterface v; + try { + v = ValueMetaFactory.createValueMeta( fieldName[i], fieldType[i] ); + } catch ( KettlePluginException e ) { + throw new KettleStepException( e ); + } {code} Reproduction Steps: # Download the attached zip file, and unzip the contents. # Open the {{test_max_date.kjb}} file in Spoon, and click Execute. Expected Results: The job runs successfully, and the correct timestamp is shown in the job log. Actual Results: The job fails with the error message shown above.
    via by Matt Tucker,
  • Base transaction does a mapping to a sub-transaction. In a java script in the subtransaction is a boolean variable declared and exported as field. This field is returned to the calling transaction through mapping (output). In a java script in the calling transaction the value of the boolean is changed. You get the following error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unexpected error 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Javascript error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Javascript error: 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.mozilla.javascript.NativeBoolean cannot be cast to java.lang.Boolean 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:457) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:688) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : at java.lang.Thread.run(Thread.java:662) 2012/02/01 10:44:05 - Modified Java Script Value.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Caused by: org.pentaho.di.core.exception.KettleValueException:
    via by Thomas Bednarz,
    • org.pentaho.di.core.exception.KettleValueException: Javascript error: ReferenceError: "result" is not defined. (script#4) ``` at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:458) at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:689) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50) at java.lang.Thread.run(Thread.java:722)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,