1 Reply Latest reply: Apr 19, 2010 3:06 AM by ErikYkema RSS

    The java class is not found: com.retek.alloc.service.AlcService

    683218
      Hi,

      I am trying to run one ksh script it is giving below error.

      $ah_infc_asn_alloc_create.ksh ALLOC_CREATE CROSSDOCK QUZ
      ----

      --------------------------------------------------------------------------------

      --------------------------------------------------------------------------------
      The java class is not found: com.retek.alloc.service.AlcService

      PL/SQL procedure successfully completed.

      Alert report not found,not invoking the mailer script
      $

      $vi ah_infc_asn_alloc_create.ksh
      #!/usr/bin/ksh
      ################################################################################
      #

      1.File : ah_infc_asn_alloc_create.ksh
      #

      1.Description : Covering Shellscript for invoking ASN /ALLOC create package
      #

      1.Usage : Covering Shellscript for invoking ASN /ALLOC create package
      #
      #
      #

      1.Author Date Ver Description
      #
      #
      --------------------------------------------------------------------------------

      --------------------------------------------------------------------------------

      --------------------------------------------------------------------------------

      --------------------------------------------------------------------------------
      #

      1.Abhishek 27-Feb-2008 1.00 Created
      #

      1.Antulika 27-Feb-2008 2.00 Adding ah_infc_ob.env #
      2.Ganesh 28-Feb-2008 3.00 Adding Create allocation class invocation
      #

      1.Murali 04-Jun-2008 4.00 Added the absoulte path for the scripts
      #

      1.Ankit 06-Jan-2009 5.00 Added a check to exit if PROGRAM_TYPE
      #

      1.is not ALLOC_CREATE
      #

      1.Ankit 06-Feb-2009 6.00 Corrected exit code when no alerts found
      #
      #Manisha 07-Aug-2009 6.10 Replaced Java code for SessionID generatio
      n #

      1.with PL sql statements. #
      ################################################################################
      #

      echo 'Starting the script for ASN/Allocation creation Batch'

      . $ENV_HOME/ah_infc_ib.env
      . $ENV_HOME/ah_infc_ftp.env

      if (test $# -lt 2) then
      echo 'Atleast 2 arguments should be passed(ASN/Alloc creation , PO Type)'
      echo 'Usage : ah_infc_asn_alloc_create.ksh ASN_CREATE NORMAL/CROSSDOCK BRAND(
      OPTIONAL)'
      exit -1
      fi

      LOG_CFG_FILE=$INFC_ROOT/etc/ah_infc_com_log.xml
      UPC=$DB_USER_NAME/$DB_USER_PWD$DB_CONN_STR

      PROGRAM_TYPE=$1
      PO_TYPE=$2
      BRAND_ID=$3
      Date12=`date "+%Y%m%d"`

      #Output file directory in local server
      ASN_ALLOC_CREATE_BATCH_DIR=`eval echo '$'${PROGRAM_TYPE}_OUT_DIR`
      #Output Database direcotory name corresponing to ASN_ALLOC_CREATE_BATCH_DB_DIR
      ASN_ALLOC_CREATE_BATCH_DB_DIR=`eval echo '$'${PROGRAM_TYPE}_OUT_DB_DIR`

      echo $ASN_ALLOC_CREATE_BATCH_DIR

      #Temporary file for holding session id
      SESSION_ID_FILE=$ASN_ALLOC_CREATE_BATCH_DIR/${PROGRAM_TYPE}${PO_TYPE}SF

      #Generate the session ID file
      echo 'Generating session ID'

      sessionID=`sqlplus -s $UPC << EOF

      SET PAGESIZE 0
      SET HEADING OFF
      SET TRIMSPOOL ON
      SET VERIFY OFF
      SET FEEDBACK OFF
      SET SERVEROUTPUT ON SIZE 999999
      SET SERVEROUT ON

      declare
      result AH_INFC_SESSION.SESSION_ID%TYPE;
      out_error VARCHAR2(2000);
      ret_val BOOLEAN;

      begin
      ret_val:= ah_infc_session_fn ('GENERATE',out_error,result);

      IF ret_val THEN
      dbms_output.put_line(result);
      ELSE
      dbms_output.put_line(out_error);
      END IF;

      end;
      /
      EOF
      `

      DB_ERR=`echo $sessionID | grep "ERROR:"`

      #if DB_ERR is not null, exit
      if ( test ${#DB_ERR} -eq 0 ) then
      echo 'Session is:'$sessionID
      else
      echo "Error generating session_id. Error message: " $sessionID
      exit -1
      fi

      export sessionID


      ALERT_FILE_NAME=Alerts_${PROGRAM_TYPE}_${PO_TYPE}_${sessionID}_${Date12}.csv
      mailing_file=Alerts_${PROGRAM_TYPE}.csv



      #get process ID
      processID=$$

      echo 'process ID is '$processID

      #Call the PL SQL Procedures
      echo 'Calling the Oubound procedure for brand id '$BRAND_ID' and interface type
      '$INFC_TYPE

      echo "****************BEGIN - PL/SQL************************"


      sqlplus -s /nolog << EOF | grep -vi connected
      WHENEVER SQLERROR CONTINUE
      conn $DB_USER_NAME/$DB_USER_PWD$DB_CONN_STR


      set serveroutput on
      DECLARE

      o_error_message VARCHAR2(2000);
      lb_ret_val BOOLEAN;



      BEGIN
      --Inserting session information in session table
      INSERT INTO ah_infc_session
      (
      session_id,
      process_id,
      program_name,
      user_id,
      status,
      start_time,
      brand_id,
      interface_id)
      VALUES (
      '$sessionID',
      '$processID',
      '$PROGRAM_TYPE',
      USER,
      'In_Progress',
      SYSDATE,
      '$BRAND_ID',
      '$PROGRAM_TYPE'
      );

      commit;
      dbms_output.put_line ('Calling Outbound package');
      lb_ret_val:=ah_infc_allocation_pkg.ah_fn_infc_asn
      (
      '$sessionID',
      '$PO_TYPE',
      o_error_message
      );

      END;
      /

      EOF

      echo "****************END - PL/SQL************************"

      if ; then
      #class file invocation to create the Allocation
      echo 'Creating Manual Allocation'
      echo $CLASSPATH
      $JAVA_HOME/bin/java -Dlog4j.trace=true -Dlog4j.configuration=$ALC_LOG_CFG_FILE -
      DCNFG_FILE=$INFC_COM_CFG_FILE -classpath $CLASSPATH com.retek.alloc.business.All
      ocationCreation
      fi


      sqlplus -s /nolog << EOF | grep -vi connected
      WHENEVER SQLERROR CONTINUE
      conn $DB_USER_NAME/$DB_USER_PWD$DB_CONN_STR


      set serveroutput on

      declare
      out_file_dir VARCHAR2(100):='$ASN_ALLOC_CREATE_BATCH_DB_DIR';
      ln_alert_cnt NUMBER;
      o_error_message VARCHAR2(2000);

      begin


      --Fetching the alerts count for sessionid
      SELECT COUNT (session_id)
      INTO ln_alert_cnt
      FROM ah_infc_alerts
      WHERE session_id = '$sessionID';

      IF (ln_alert_cnt > 0)
      THEN
      DBMS_OUTPUT.put_line
      (
      'Alerts found in AH_INFC_ALERTS table for session id:'
      || '$sessionID'
      );
      --Updating session status to failed

      update AH_INFC_SESSION
      set status ='Failed',
      stop_time= SYSDATE
      where session_id='$sessionID';

      DBMS_OUTPUT.put_line ('Calling Alert report generation package');
      ah_infc_alert_report_pkg.ah_infc_alert_report_pr
      (
      '$BRAND_ID',
      '$ALERT_FILE_NAME',
      '$sessionID',
      out_file_dir
      );

      ELSE
      --Updating session status to Success
      update AH_INFC_SESSION
      set status ='Success',
      stop_time= SYSDATE
      where session_id='$sessionID';
      END IF;

      COMMIT;

      END;
      /

      EOF



      1.<Ankit> <If there are no alert report generated, exit with status o>

      ls -l $ASN_ALLOC_CREATE_BATCH_DIR/$ALERT_FILE_NAME > temp_file.txt 2>&1
      #if the Alert file is found, then send out Alert file
      if (test $? -eq 0) then
      echo "calling the mailer script to mail the error alert"
      $INFC_ROOT/bin/ah_mailer.ksh $PROGRAM_TYPE $mailing_file Interface_ASN_
      ALLOC_batch_Alert $ASN_ALLOC_CREATE_BATCH_DB_DIR
      exit -1
      else
      echo "Alert report not found,not invoking the mailer script"
      exit 0
      fi

      rm -f temp_file.txt;
      echo 'Deleting session ID file'
      rm -f $SESSION_ID_FILE;
      exit 0




      1.







      •Feedback Batch processing ends here

      Thanks
        • 1. Re: The java class is not found: com.retek.alloc.service.AlcService
          ErikYkema
          Hi Quadri,
          I suggest that you repost your issue at
          Retail the Oracle Retail OTN Forum. Allocations sounds to be more relevant there.
          Do you have any documentation on this batch program ah_infc_asn_alloc_create? What version of RAL are we talking to?
          I am pretty sure that this script is a custom program, non-base. And com.retek.alloc.service.AlcService, is that base?

          Would check the classpath and the location of the libs with the mentioned service.

          Erik