org.pentaho.di.core.exception.KettleValueException: Javascript error: Javascript error: org.mozilla.javascript.NativeBoolean cannot be cast to java.lang.Boolean

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.

  • 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,
  • 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,
  • While adding row in database it generate a unique id(primiry key), of type uuid, consisting the characters. Generating function is uuid_generate_v1(). When i try to return the value of the generated id(enable checkbox "Return auto-generated key"), Kettle tries to convert it to integer and returns an error: "could not convert String to Integral." "2014/09/12 16:22:17 - Table output 2.0 - ERROR (version 5.1.0.0, build 1 from 2014-06-19_19-02-57 by buildguy) : Because of an error, this step can't continue: 2014/09/12 16:22:17 - Table output 2.0 - ERROR (version 5.1.0.0, build 1 from 2014-06-19_19-02-57 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 2014/09/12 16:22:17 - Table output 2.0 - Unexpected conversion error while converting value [id String] to an Integer 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - id String : couldn't convert String to Integer 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - id String : couldn't convert String to number : non-numeric character found at position 1 for value [eeec091d-a056-4117-984c-74894ce644ba] 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.core.row.value.ValueMetaBase.getInteger(ValueMetaBase.java:1815) 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.core.row.RowMeta.getInteger(RowMeta.java:254) 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:312) 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:118) 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2014/09/12 16:22:17 - Table output 2.0 - at java.lang.Thread.run(Thread.java:745) 2014/09/12 16:22:17 - Table output 2.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2014/09/12 16:22:17 - Table output 2.0 - id String : couldn't convert String to Integer 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - id String : couldn't convert String to number : non-numeric character found at position 1 for value [eeec091d-a056-4117-984c-74894ce644ba] 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToInteger(ValueMetaBase.java:1039) 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.core.row.value.ValueMetaBase.getInteger(ValueMetaBase.java:1748) 2014/09/12 16:22:17 - Table output 2.0 - ... 5 more 2014/09/12 16:22:17 - Table output 2.0 - Caused by: org.pentaho.di.core.exception.KettleValueException: 2014/09/12 16:22:17 - Table output 2.0 - id String : couldn't convert String to number : non-numeric character found at position 1 for value [eeec091d-a056-4117-984c-74894ce644ba] 2014/09/12 16:22:17 - Table output 2.0 - 2014/09/12 16:22:17 - Table output 2.0 - at org.pentaho.di.core.row.value.ValueMetaBase.convertStringToInteger(ValueMetaBase.java:1031) 2014/09/12 16:22:17 - Table output 2.0 - ... 6 more"
    via by Alexander,
    • org.pentaho.di.core.exception.KettleValueException: Javascript error: Javascript error: org.mozilla.javascript.NativeBoolean cannot be cast to java.lang.Boolean at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:457) at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:688) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40) at java.lang.Thread.run(Thread.java:662)

    Users with the same issue

    Unknown visitor1 times, last one,