Results 1 to 3 of 3

Thread: zimbra, java and cron

  1. #1
    johnsonpeter is offline Junior Member
    Join Date
    Apr 2008
    Posts
    5
    Rep Power
    7

    Default zimbra, java and cron

    Hi,
    I've been struggling with this all day and it seems like a problem that someone must have already solved.

    I have a java program that updates zimbra based on data in an oracle database. It executes just fine at the command line and in in a bash shell script.

    When I call the script from cron it fails with the following error, although a simple java program in the same script will execute just fine.:
    #
    # An unexpected error has been detected by Java Runtime Environment:
    #
    # SIGSEGV (0xb) at pc=0x0638e976, pid=10301, tid=3086879648
    #
    # Java VM: Java HotSpot(TM) Server VM (10.0-b22 mixed mode linux-x86)
    # Problematic frame:
    # V [libjvm.so+0x38e976]
    #
    # An error report file with more information is saved as:
    # /home/oracle/zimbra/hs_err_pid10301.log
    #
    # If you would like to submit a bug report, please visit:
    # HotSpot Virtual Machine Error Reporting Page



    Here is the script:
    :

    cd ~oracle/zimbra

    export ORACLE_SID=prod
    export ORAENV_ASK=NO
    . /usr/local/bin/oraenv

    export ORAHOME=/oracle
    export PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/oracle/bin:/usr/X11R6/bin:/home/oracle/bin
    export LD_LIBRARY_PATH=/oracle/lib:/opt/jdk1.6.0_06/jre/lib/i386/server/

    # set the classpath var.
    export CLASSPATH=/oracle/jdbc/lib/classes12.jar:./jars/activation.jar:./jars/ant-1.7.0-ziputil-patched.jar:./jars/ant-contrib-1.0b1.jar:./jars/bouncycastle.jar:./jars/catalina-ant.jar:./jars/commons-beanutils-1.6.1.jar:./jars/commons-cli-2.0.jar:./jars/commons-codec-1.3.jar:./jars/commons-collections-3.1.jar:./jars/commons-dbcp-1.1.jar:./jars/commons-digester-1.5.jar:./jars/commons-fileupload-1.0-zimbra.jar:./jars/commons-httpclient-3.0.jar:./jars/commons-logging.jar:./jars/commons-pool-1.1.jar:./jars/concurrent-1.3.4-zimbra-1.0.0.jar:./jars/dom4j-1.5.jar:./jars/ganymed-ssh2-build209.jar:./jars/ical4j-0.9.16-patched.jar:./jars/jakarta-oro-2.0.7.jar:./jars/java_memcached-release_1.6.jar:./jars/jaxen-1.1-beta-3.jar:./jars/jcommon-1.0.0.jar:./jars/jetty-6.1.5.jar:./jars/jetty-util-6.1.5.jar:./jars/jfreechart-1.0.1.jar:./jars/jsieve-0.1-zimbra.jar:./jars/junit-3.8.1.jar:./jars/jzlib.jar:./jars/KeyView.jar:./jars/libidn-1.0.jar:./jars/log4j-1.2.8.jar:./jars/lucene-core-2.3.1.jar:./jars/mail.jar:./jars/mina-core-1.1.0-zimbra.jar:./jars/mina-filter-ssl-1.1.0.jar:./jars/mysql-connector-java-5.0.3-bin.jar:./jars/nekohtml.jar:./jars/slf4j-api-1.3.1.jar:./jars/slf4j-log4j12-1.3.1.jar:./jars/tnef-1.3.0.jar:./jars/whack.jar:./jars/xercesImpl.jar:./jars/xpp3.jar:./jars/yuicompressor-2.3.4.jar:./jars/zimbra-charset.jar:./jars/zimbracommon.jar:./jars/zimbraim.jar:./jars/zimbra-native.jar:./jars/zimbrastore.jar:/oracle/jdbc/lib/classes12.jar

    /opt/jdk1.6.0_06/bin/java -classpath ${CLASSPATH}:. show_date > update.log

    /opt/jdk1.6.0_06/bin/java -Djavax.net.ssl.trustStore=/home/oracle/.keystore -Djavax.net.ssl.trustStorePassword=xxxxxxxxx -classpath ${CLASSPATH}:. update_zimbra >> update.log




    How do you call a java program that accesses zimbra from cron?

  2. #2
    padraig's Avatar
    padraig is offline Elite Member
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Default

    i tend to use:

    su - zimbra -c 'some_command'
    e.g.
    su - zimbra -c ' tomcat restart'
    Thanks For any replies,
    p.

  3. #3
    Baylink is offline Elite Member
    Join Date
    Aug 2008
    Location
    St Pete FL USA
    Posts
    392
    Rep Power
    7

    Default

    Programs executed from cron have *no environment at all*; this is a common problem, Java or otherwise.

    Try setting TERM in your wrapper script, just for grins and giggles.
    Jay R. Ashworth - ZCS 6.0.9CE/CentOS5 - St Pete FL US - Music - Blog - Photography - IANAL - IAAMA
    Try to Ask Questions The Smart Way -- you'll get better answers.

    Put your product and version in your profile/signature - All opinions strictly my own, even though I have an employer these days.
    If you [SOLVE] something, please tell everyone how for the archives
    And, please... read what people write, and answer the questions they asked, not the ones they didn't.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •