Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: mysterious exceptions in JavaScript

  1. #1
    Join Date
    Nov 2007
    Posts
    18

    Default mysterious exceptions in JavaScript

    We are getting a couple of different exceptions related to JavaScript. Unfortunately these don't give us any indication what is wrong. We spent a couple of days trying to debug this without any success.

    What do these exceptions mean?:

    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : Javascript error: org.mozilla.javascript.EvaluatorException: Invalid JavaScript value of type org.mozilla.javascript.UniqueTag
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : Error stack trace:
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : org.mozilla.javascript.EvaluatorException: Invalid JavaScript value of type org.mozilla.javascript.UniqueTag
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:64)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.Context.reportRuntimeError(Context.java:815)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.Context.reportRuntimeError(Context.java:870)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.Context.reportRuntimeError1(Context.java:834)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.ScriptRuntime.errorWithClassName(ScriptRuntime.java:2346)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.ScriptRuntime.toNumber(ScriptRuntime.java:151)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at org.mozilla.javascript.Context.toNumber(Context.java:1465)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:270)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:489)
    2007/12/19 13:48:03 - Assign Page Ids.0 - ERROR (version 2.5.1, build 4 from 2007/11/19 14:35:37) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.run(ScriptValuesMod.java:550)

    -AND-

    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : Javascript error: java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.String
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : Error stack trace:
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to java.lang.String
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:365)
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:282)
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:483)
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) : at be.ibridge.kettle.trans.step.scriptvalues_mod.ScriptValuesMod.run(ScriptValuesMod.java:544)
    2007/12/19 13:56:33 - PageSeqGenerator.0 - ERROR (version 2.5.1, build 1 from 2007/12/19 13:56:23) :

    This is with Kettle 2.5.1. We are still using it because we couldn't get any of our transformations to run in 3.0.1 (seems it isn't compatible). Thanks.

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Without transformation little to say on it ... but first read http://wiki.pentaho.org/display/EAI/...2.5.x+to+3.0.0

    Regards,
    Sven

  3. #3
    Join Date
    Nov 2007
    Posts
    18

    Default

    I can't post the transformation because it is proprietary to our company. But here is one interesting clue. We ran the job from Kitchen.bat and noticed the following message on stderr:

    RHINO USAGE WARNING: Missed Context.javaToJS() conversion:
    Rhino runtime detected object org.mozilla.javascript.UniqueTag@4c71d2: NOT_FOUND
    of class org.mozilla.javascript.UniqueTag where it expected String, Number, Boolean or Scriptable instance. Please check your code for missing Context.javaToJS() call.

    Maybe this helps to pinpoint the problem. Thanks.

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    Nope... try to cut down your transformation until you have something that still bombs out but where nothing/or not much is left of your proprietary things

    Regards,
    Sven

  5. #5
    Join Date
    Dec 2007
    Posts
    3

    Unhappy

    I'm using version 3.1 M2.
    There is no issue while running a mapping with modified JavaScript on windows XP. But while running the same mapping remotely on RedHat Linux(x64) using carte slave server, I'm getting the following error in the log file and the process is terminating. Using other data types in JS is also producing similar error. I have also attached a stripped down version of the mapping(JS_Error.ktr).

    Thanks,
    Aray


    Javascript error:

    Javascript error:
    JavaScript conversion to BigNumber not implemented for org.mozilla.javascript.UniqueTag


    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:443)
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:745)
    at org.pentaho.di.trans.step.BaseStep.runStepThread(BaseStep.java:2444)
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.run(ScriptValuesMod.java:815)
    Caused by: org.pentaho.di.core.exception.KettleValueException:
    Javascript error:
    JavaScript conversion to BigNumber not implemented for org.mozilla.javascript.UniqueTag

    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:696)
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:390)
    ... 3 more
    Caused by: java.lang.RuntimeException: JavaScript conversion to BigNumber not implemented for org.mozilla.javascript.UniqueTag
    at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:672)
    ... 4 more
    Attached Files Attached Files

  6. #6
    Join Date
    May 2006
    Posts
    151

    Lightbulb org.mozilla.javascript.UniqueTag cannot be cast to java.lang.Boolean

    Hi!

    I have experienced this error too. In my case, it was caused because I accidentally removed the variable declaration in the script corresponding to a field defined in the "Fields" grid.

    Note that this error is *not* caught by the "Test script" button. Perhaps that functionality should be fixed to check this.
    kind regards,

    Roland Bouman
    http://rpbouman.blogspot.com/
    @rolandbouman on twitter
    Author of "Pentaho Solutions" (Wiley, ISBN: 978-0-470-48432-6)
    Author of "Pentaho Kettle Solutions" (Wiley, ISBN: 978-0-470-63517-9)

  7. #7
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    It changed quite a bit in 3.2.0-M1 :-)

  8. #8

    Default

    Just for information, I had the same problem, and as one said before, it was a var non initialized

    var myvar='';
    if(test=value) { myvar=blabla;}

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.