Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Javascript jar file for Transforms called from java

  1. #1
    Join Date
    May 2013
    Posts
    6

    Exclamation Javascript jar file for Transforms called from java

    I've created a number of transforms that I'm calling from a java-based webapp. All work fine except for the ktr with a "Script Values / Mod" widget in it. I've put js.jar and js-1.7R1.jar in the classpath to no avail. The transform runs fine in Spoon. The error is "NoClassDefFoundError: org/mozilla/javascript.ContextFactory".

    The other transforms find their .jar files just fine (kettle-*.jar, scannotation-1.0.2.jar, secondstring.jar, etc.) but the javascript one just isn't working.

    This is a showstopper for me right now so any help is greatly appreciated.

    Thanks.

    Fred
    Last edited by FredDunn; 06-28-2013 at 02:16 PM.

  2. #2
    Join Date
    May 2013
    Posts
    6

    Default

    Bump.

  3. #3
    Join Date
    Jul 2009
    Posts
    476

    Default

    I'm not a Java expert, but I looked inside the js.jar (zip)file under the libext directory in my PDI 4.4 Community Edition, and I see ContextFactory.class in the org/mozilla/javascript folder, so you shouldn't get that error if js.jar is really in the classpath.

  4. #4
    Join Date
    Mar 2011
    Posts
    19

    Default

    I'm a bit unclear here: is that a "Modified Java Script Value" step? Are you running this from Kitchen or Pan or something like that?

    I've found as long as your environment starts up OK these will work.

  5. #5
    Join Date
    May 2013
    Posts
    6

    Default

    robj - I agree, I can see the class in the .jar file. The issue is I'm running the transform from a Grails-based Java web application, not from within Spoon. It runs fine inside Spoon. I have other transforms that use widgets that requre external jars, for example secondstring.jar and scannotation.jar, and they run fine. It's only the javascript widget that for some reason can't find its jar file. The jar is included in the .classpath file of Grails along with the kettle-*.jar files, etc. For some reason it's just the Javascript widget that's having a problem.

    It's a head-scratcher for sure.

  6. #6
    Join Date
    May 2013
    Posts
    6

    Default

    mr_than - It's listed under the Scripting/Modified Java Script Value menu. It allows you to write javascript code to operate on fields as they flow through the transform.

    The issue is I'm running the transform from a Grails-based Java web application, not from within Spoon. It runs fine inside Spoon. I have other transforms that use widgets that requre external jars, for example secondstring.jar and scannotation.jar, and they run fine. It's only the javascript widget that for some reason can't find its jar file. The jar is included in the .classpath file of Grails along with the kettle-*.jar files, etc. For some reason it's just the Javascript widget that's having a problem.

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.