Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Pentaho Schedule Jobs in Crontab problem

  1. #1
    Join Date
    Sep 2017
    Posts
    6

    Default Pentaho Schedule Jobs in Crontab problem

    Hello,

    I have a problem. I'm trying to schedule some jobs on my Ubuntu server. I was thinking that it will be easy to achive it, but...

    I've executed command crontab -e and add new line:


    39 14 * * * /home//Repository/jobs/test.sh

    cat test.sh

    #!/bin/bash




    PATH=/opt/data-integration:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin


    dte=$(date +"%Y%m%d_%H%M")
    start=$(date +"%F_%T")
    results_log=~/Repository/jobs/logs/tbl_cpp_c_items_$dte.log


    cd /opt/data-integration
    statement="./pan.sh -file "/home/rwesolowski/Repository/tbl_cpp_c_items.ktr""


    echo $start > "$results_log"
    chmod 744 "$results_log"
    echo $statement >> "$results_log"
    $statement >> "$results_log" 2>> "$results_log"
    date +%F_%T >> "$results_log"


    It seems that everything should work but during crone execution in logs error occurred:

    ./pan.sh -file /home/rwesolowski/Repository/tbl_cpp_c_items.ktr
    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/pentaho/commons/launcher/Launcher : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:648)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:272)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:68)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:207)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:201)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:200)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:325)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:296)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:270)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:406)

    Even more, it is strange because without crontab everything is ok and this test.sh is executed correctly.
    Any help would be appreciated

  2. #2
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Do you have multiple Java installations on your system?
    Because that's the error you get if you use a Java 8 compiled launcher in a Java 7 VM.
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Jul 2009
    Posts
    476

    Default

    You can tell Pentaho which version of Java to use by setting an environment variable. If you trace through the shell scripts, you'll see how environment variables affect the Java version selection. On my (rather old) version of PDI, pan.sh calls spoon.sh, which in turn runs set-pentaho-env.sh, which is the script that selects the Java version. The set-pentaho-env.sh file also has comments that explain how it makes that choice, based on environment variables. All of these scripts are in the same directory.

    Your version of PDI should work in a similar way, if not exactly the same way.
    Last edited by robj; 12-05-2017 at 10:07 AM. Reason: clarify wording

  4. #4
    Join Date
    Sep 2017
    Posts
    6

    Default

    Yes, it was related with JAVA. I've added:
    JAVA_HOME=/usr/lib/jvm/java-8-oracle
    It works, thanks!

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.