Mail recieving problem

Hi

I have been trying to resolve this issue refering to all your previous post..... but had a hard luck. Below is the code which is when run from command prompt sends the mail taking the mail related crediantials ( email id where to send the mail ) from a xml file whose path is mentioned in RUNTIME_OPTIONS as -Dconfig.file=$CONFIG_HOME/batch.xml.

Please see the code :

**********************************************************
#!/bin/ksh
#
#     This Script will Start Policy Verification 
###########################################
cd /opt/bea/wls61/config/dev05/batch_automation/batchPolicy 
JAVA_HOME=/opt/bea/jdk131
WL_HOME=/opt/bea/wls61
INSTANCE=dev05
FRAMEWORK_LIB=$WL_HOME/config/$INSTANCE/lib/com/fits
SERVICE_HOME=$WL_HOME/config/$INSTANCE/services
BATCH_HOME=$WL_HOME/config/$INSTANCE/batch_automation/lib
CONFIG_HOME=$WL_HOME/config/$INSTANCE/batch_automation/config

CLASSPATH=.:$BATCH_HOME/batch.jar:$BATCH_HOME/classes12.jar:$SERVICE_HOME/plus/lib/com/fits/plus.jar:$SERVICE_HOME/diary/lib/com/fits/diary.jar:$FRAMEWORK_LIB/FitsUtil.jar:$FRAMEWORK_LIB/FitsFramework.jar:$FRAMEWORK_LIB/jdom.jar:$BATCH_HOME/NetComponents.jar:$FRAMEWORK_LIB/xercesImpl.jar:$FRAMEWORK_LIB/customerService.jar:$SERVICE_HOME/numbering/lib/numberingService.jar:$SERVICE_HOME/question/lib/com/fits/QuestionEngine.jar:$WL_HOME/lib/weblogic.jar:$SERVICE_HOME/ios/lib/ios.jar:$BATCH_HOME/AccountService.jar:$BATCH_HOME/AddressService.jar:$BATCH_HOME/Producer.jar:$FRAMEWORK_LIB/FITSDBPool.jar

BATCH_LIB=$BATCH_HOME/lib

CLASSPATH=$BATCH_HOME/claims.jar:$BATCH_HOME/mail.jar:$BATCH_HOME/activation.jar:$CLASSPATH

RUNTIME_OPTIONS="-Dconfig.file=$CONFIG_HOME/batch.xml  -Duser.timezone=America/New_York -Djava.naming.factory.initial=weblogic.jndi.T3InitialContextFactory -Djava.naming.provider.url=t3://172.16.18.149:8005 -Djava.naming.security.principal=system -Djava.naming.security.credentials=mfxclaims"

mv ./logs/200* ./logs/bak
echo RUNTIME_OPTIONS=$RUNTIME_OPTIONS
echo CLASSPATH=$CLASSPATH

$JAVA_HOME/bin/java $RUNTIME_OPTIONS -cp $CLASSPATH com.fits.service.claimservice.batch.policyverification.BatchPolicyVerificationMain  $1 $2 $3 > logs/batchPolicy.log  2>&1
*********************************************************

Now above script when run as ./startBatchPolicy.sh sends the mail refering to batch.xml file ( looks for email id to which mail has to be sent ) .

Now what I did is, instead of declaring the variables in the same script , I made a common script & invoked this common script in other script.

Following is the common script ( batch_settings.sh that contais all common variable settings ):

*********************************************************
##########################################################
#! /bin/ksh
# This is setting file invoked by  each batch job. 
#
###########################################################

export JAVA_HOME=/opt/bea/jdk131
export BEA_HOME=/opt/bea
export WL_HOME=/opt/bea/wls61
export INSTANCE=dev05
export FRAMEWORK_LIB=$WL_HOME/config/$INSTANCE/lib/com/fits
export SERVICE_HOME=$WL_HOME/config/$INSTANCE/services
export CONFIG_HOME=$WL_HOME/config/$INSTANCE/batch_automation/config
export BATCH_HOME=$WL_HOME/config/$INSTANCE/batch_automation
export COMMON_LIB=$BATCH_HOME/lib
export WL_LIB=$WL_HOME/lib
export APP_HOME=$WL_HOME/config/$INSTANCE
export SECURITY=$APP_HOME/applications/securityframework
export INITIAL_CONTEXT_PROVIDER=t3://172.16.18.149:8005

export CLASSPATH=.:$WL_HOME/lib/weblogic.jar:$COMMON_LIB/mail.jar:$COMMON_LIB/activation.jar:$COMMON_LIB/batch.jar:$COMMON_LIB/claims.jar:$COMMON_LIB/wlicommon.jar:$COMMON_LIB/docucorp.jar:$COMMON_LIB/security.jar:$COMMON_LIB/AddressService.jar:$COMMON_LIB/ais.jar:$COMMON_LIB/Producer.jar:$COMMON_LIB/classes12.jar:$COMMON_LIB/AccountService.jar:$COMMON_LIB/NetComponents.jar:$COMMON_LIB/customerservice.jar:$COMMON_LIB/castor.jar:$COMMON_LIB/claims-container.jar:$COMMON_LIB/ids.jar:$COMMON_LIB/jdom.jar:$COMMON_LIB/numberingService.jar:$COMMON_LIB/plus.jar:$COMMON_LIB/diary.jar:$COMMON_LIB/ais.jar:$COMMON_LIB/DocucorpMsg.jar:$COMMON_LIB/MbpsBatch.jar:$COMMON_LIB/dom4j.jar:$COMMON_LIB/commons-logging.jar:$COMMON_LIB/cglib2.jar:$COMMON_LIB/commons-lang.jar:$COMMON_LIB/FitsFramework.jar:$COMMON_LIB/FitsUtil.jar:$COMMON_LIB/hibernate2.jar:$COMMON_LIB/jdbc2_0-stdext.jar:$COMMON_LIB/jta.jar:$COMMON_LIB/junit.jar:$COMMON_LIB/odmg.jar:$COMMON_LIB/QuestionEngine.jar:$COMMON_LIB/xerces.jar:$COMMON_LIB/jxl.jar:$COMMON_LIB/ibatis-sqlmap-2.jar:$COMMON_LIB/ibatis-common-2.jar:$COMMON_LIB/xercesImpl.jar:$COMMON_LIB/DocService.jar:$FRAMEWORK_LIB/FitsUtil.jar:$FRAMEWORK_LIB/customerservice.jar:$FRAMEWORK_LIB/jdom.jar:$FRAMEWORK_LIB/FitsFramework.jar:$FRAMEWORK_LIB/FITSDBPool.jar:$FRAMEWORK_LIB/xercesImpl.jar:$SERVICE_HOME/ios/lib/ios.jar:$SERVICE_HOME/numbering/lib/numberingService.jar:$SERVICE_HOME/plus/lib/com/fits/plus.jar:$SERVICE_HOME/diary/lib/com/fits/diary.jar:$SERVICE_HOME/account/lib/AccountService.jar:$SERVICE_HOME/account/lib/AddressService.jar:$SERVICE_HOME/question/lib/com/fits/QuestionEngine.jar:$CONFIG_HOME

export RUNTIME_OPTIONS="-Dconfig.file=$CONFIG_HOME/batch.xml -Duser.timezone=America/New_York -Djava.naming.factory.initial=weblogic.jndi.T3InitialContextFactory -Djava.naming.provider.url=$INITIAL_CONTEXT_PROVIDER -Djava.naming.security.principal=system -Dbea.home=$BEA_HOME -Dlog.dir=./logs -Djava.naming.security.credentials=mfxclaims"

*********************************************************

Below is the script that envokes the above script ie batch_settings.sh.

***************************************

#! /bin/ksh
#
#     This Script will Start Policy Verification 
###########################################
cd /opt/bea/wls61/config/dev05/batch_automation/batchPolicy 
.  /opt/bea/wls61/config/dev05/batch_automation/batch_settings.sh

mv ./logs/200* ./logs/bak
echo RUNTIME_OPTIONS=$RUNTIME_OPTIONS
echo CLASSPATH=$CLASSPATH


$JAVA_HOME/bin/java $RUNTIME_OPTIONS -cp $CLASSPATH com.fits.service.claimservice.batch.policyverification.BatchPolicyVerificationMain  $1 $2 $3 > logs/batchPolicy.log  2>&1 &

************************************************************

Now with this optimized code evrything is ok except that it is not sending mail as the uppermost code used to....... I am really confused....... Any help will be highly appreciated..........

Thanks

Pankaj

Do all the three scripts appear just like the above in the actual script ?

Because, the shebang #! /bin/ksh should ALWAYS be the first line of the script.

Hi

Yeah All the script starts with

#!/bin/ksh.

Regards
Pankaj