Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: org.mozilla.javascript.UniqueTag issue

  1. #1
    Join Date
    Aug 2011
    Posts
    236

    Default org.mozilla.javascript.UniqueTag issue

    Hi,

    I have a modified JS component and I am getting a org.mozilla.javascript.UniqueTag@490fbc83: NOT_FOUND error.

    I am trying to generate a SOAP request and following the SOAP example transformation.

    The script is :-


    function pad(number, length) {
    var str = '' + number;
    while (str.length < length) {
    str =
    '0' + str;
    }
    return str;
    }

    <script type=
    "text/javascript" src="/usr/src/pentaho/data-integration/Files/crypto-sha1-hmac.js"></script>;

    <script type=
    "text/javascript">
    var today = new Date();
    var getyear = today.getFullYear();
    var getmonth = pad(today.getMonth(), 2);
    var getday = pad(today.getDate(), 2);
    var gethour = pad(today.getHours(), 2);
    var getminute = pad(today.getMinutes(), 2);
    var getseconds = pad(today.getSeconds(), 2);
    var gmthours = -today.getTimezoneOffset() /60;
    var secretKey = "company_key";

    var access_key = "company_id";

    var hashtime = getyear + "-" + getmonth + "-" + getday + "T" + gethour + ":" + getminute + ":" + getseconds + gmthours + ":00";

    var encrypt_value = hashtime + access_key;

    var signature = new Crypto.HMAC(Crypto.SHA1, encrypt_value, secretKey);

    var xml_request = new XML()

    xml_request=<SOAP-ENV:Envelope xmlns:SOAP-ENV=
    "http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://www.marketo.com/mktows/"><SOAP-ENV:Header><ns1:AuthenticationHeader><mktowsUserId>access_key</mktowsUserId><requestSignature>signature</requestSignature><requestTimestamp>hashtime</requestTimestamp></ns1:AuthenticationHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1aramsGetLead><leadKey>EMAIL<keyType></keyType><keyValue>testLead@marketo.com</keyValue></leadKey></ns1aramsGetLead></SOAP-ENV:Body></SOAP-ENV:Envelope>;

    var requestXml=xml_request.toXMLString();

    </script>

    My JS is not too great so I am having trouble trying to debug the cryptic message.

    Any help would be great. I am using PDI 4.1.0

    Thanks,

  2. #2
    Join Date
    Sep 2009
    Posts
    810

    Default

    Hey there,

    It looks to me like maybe you're trying to achieve too much at once.

    Let me give a few pointers
    - There's a LoadScriptFile function to include JS from an external source. (Look for it in the "special" section. Right click to see the docs) Afaik, the JS step does not support <script> tags
    - Try to build your request step by step. Maybe just use a generate row step (1 row) and attach the JS step to it. The JS will be executed once. Use either java.System.out.println("stuff") to print diagnostic messages to the console (if you're on linux) or maybe writeToLog() (also "special" section) to write to the log window.
    - Your specific error message is usually generated when the JS step is trying to return a field for which it does not find a variable. So if you define an output field "foo", but there's no variable foo defined in your script, you'd get the error.

    HTH
    Cheers
    Slawo

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.