Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-17-2008, 04:11 PM
Junior Member
 
Posts: 5
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?
Reply With Quote
  #2 (permalink)  
Old 10-14-2008, 06:48 AM
Elite Member
 
Posts: 372
Default

i tend to use:

su - zimbra -c 'some_command'
e.g.
su - zimbra -c ' tomcat restart'
__________________
Thanks For any replies,
p.
Reply With Quote
  #3 (permalink)  
Old 10-14-2008, 07:05 AM
Elite Member
 
Posts: 380
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.