Hitachi Vantara Pentaho Community Forums
Results 1 to 9 of 9

Thread: Issue loading binary files in 3.0.0-M2

  1. #1
    Join Date
    Apr 2007
    Posts
    4

    Default Issue loading binary files in 3.0.0-M2

    Hello,

    I received an error while executing "Test script reading files into BLOBs" transformation that works fine in 2.5.

    Here is my modified script:

    CONTINUE_TRANSFORMATION;
    try
    {
    file = new Packages.java.io.File(filename.getString());
    fileInputStream = new Packages.java.io.FileInputStream(file);

    var
    content = Packages.be.ibridge.kettle.core.Const.createByteArray(file.length());
    fileInputStream.read(content, 0, file.length());
    fileInputStream.close();
    CONTINUE_TRANSFORMATION;
    }
    catch


    (e)
    {
    Alert


    (e);
    ERROR_TRANSFORMATION;
    }

    Alert from catch block returns the following:
    "TypeError: createByteArray is not a function, it is org.mozilla.javascript.NativeJavaPackage."

    and log is being populated with:

    2007/09/07 15:05:00 - Get File Names.0 - Finished processing (I=0, O=0, R=0, W=4, U=0, E=0)
    2007/09/07 15:05:01 - Read Binary File Data.0 - No tran_Status found. Transformation status checking not available.
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Unexpected error :
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : org.pentaho.di.core.exception.KettleValueException:
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Javascript error:
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) :
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Javascript error:
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : JavaScript conversion not implemented for type8
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) :
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) :
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:402)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:690)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.run(ScriptValuesMod.java:745)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Caused by: org.pentaho.di.core.exception.KettleValueException:
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Javascript error:
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : JavaScript conversion not implemented for type8
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) :
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:647)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:359)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : ... 2 more
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : Caused by: java.lang.RuntimeException: JavaScript conversion not implemented for type8
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:636)
    2007/09/07 15:05:01 - Read Binary File Data.0 - ERROR (version 3.0.0-M2, build 252004 from 2007/09/06 01:03:58) : ... 3 more
    2007/09/07 15:05:01 - Read Binary File Data.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

    -Andrew


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

    Default

    That's normal... be.ibridge.kettle.core is no longer used... it's now org.pentaho.di.core

    Any javascript that touches be.ibridge needs to be changed.

    Regards,
    Sven

  3. #3
    Join Date
    Apr 2007
    Posts
    4

    Default

    Sven,

    I changed it to

    var content = Packages.org.pentaho.di.core.Const.createByteArray(file.length());

    and results are still the same. Here is an output from log:

    : Unexpected error :
    : org.pentaho.di.core.exception.KettleValueException:
    : Javascript error:
    :
    : Javascript error:
    : JavaScript conversion not implemented for type8
    :
    :
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:402)
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:690)
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.run(ScriptValuesMod.java:745)
    : Caused by: org.pentaho.di.core.exception.KettleValueException:
    : Javascript error:
    : JavaScript conversion not implemented for type8
    :
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:647)
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:359)
    : ... 2 more
    : Caused by: java.lang.RuntimeException: JavaScript conversion not implemented for type8
    : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.getValueFromJScript(ScriptValuesMod.java:636)
    : ... 3 more
    2007/09/07 16:12:34 - Read Binary File Data.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

    Thanks,
    Andrew

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

    Default

    Attach your complete transformation and I will have a look at it tomorrow.

    Regards,
    Sven

  5. #5
    Join Date
    Apr 2007
    Posts
    4

  6. #6
    Join Date
    Apr 2007
    Posts
    4

    Default

    Sven,

    Were you able to recreate this issue with loading binary files via JavaScript?
    I tried all possible options but still receiving the same error.

    Thanks,
    Andrew

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

    Default

    Not yet... didn't have the time yet, and today something strange is happening with v3.0

    If I don't reply back the day after tomorrow, nudge me again

    Sorry,
    Sven

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

    Default

    Sven & I fixed the issue in revision 4931.

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

    Default

    Can you try with the SVN version? If you want a .jar file let me know.

    Regards,
    Sven

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.