Back Forum Reply New

Calling an Oracle SP

mand.RTGSReversalCommand.execute(R  TGSReversalCommand.java:18)       at com.sbi.rtgs.command.RTGSReversalCommand$$FastClas  sByCGLIB$$b904baed.invoke(lt;generatedgt;)       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.  java:149)       at org..aop.framework.Cglib2AopProxy$C  glibMethodInvocation.invokeJoinpoint(Cglib2AopProx  y.java:661)       at org..aop.framework.ReflectiveMethod  Invocation.proceed(ReflectiveMethodInvocation.java  :122)       at wac.utils.WacAdvice.invoke(WacAdvice.java:41)       at org..aop.framework.ReflectiveMethod  Invocation.proceed(ReflectiveMethodInvocation.java  :144)       at org..aop.framework.Cglib2AopProxy$D  ynamicAdvisedInterceptor.intercept(Cglib2AopProxy.  java:606)       at com.sbi.rtgs.command.RTGSReversalCommand$$Enhancer  ByCGLIB$$15b05838.execute(lt;generatedgt;)       at wac.framework.Invoker.invoke(Invoker.java:160)       at wac.framework.Invoker.run(Invoker.java:84)       at java.lang.Thread.run(Thread.java:534)
com.sbi.exception.SBIApplicationException       at com.sbi.exception.SBIApplicationException.throwExc  eption(SBIApplicationException.java:49)       at com.sbi.bp.TransactionBP.postTransactionToDB(Trans  actionBP.java:129)       at com.sbi.bp.TransactionBP.postTransaction(Transacti  onBP.java:68)       at com.sbi.rtgs.service.RTGSReversalService.postRever  salTranscation(RTGSReversalService.java:63)       at com.sbi.rtgs.command.RTGSReversalCommand.execute(R  TGSReversalCommand.java:18)       at com.sbi.rtgs.command.RTGSReversalCommand$$FastClas  sByCGLIB$$b904baed.invoke(lt;generatedgt;)       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.  java:149)       at org..aop.framework.Cglib2AopProxy$C  glibMethodInvocation.invokeJoinpoint(Cglib2AopProx  y.java:661)       at org..aop.framework.ReflectiveMethod  Invocation.proceed(ReflectiveMethodInvocation.java  :122)       at wac.utils.WacAdvice.invoke(WacAdvice.java:41)       at org..aop.framework.ReflectiveMethod  Invocation.proceed(ReflectiveMethodInvocation.java  :144)       at org..aop.framework.Cglib2AopProxy$D  ynamicAdvisedInterceptor.intercept(Cglib2AopProxy.  java:606)       at com.sbi.rtgs.command.RTGSReversalCommand$$Enhancer  ByCGLIB$$15b05838.execute(lt;generatedgt;)       at wac.framework.Invoker.invoke(Invoker.java:160)       at wac.framework.Invoker.run(Invoker.java:84)       at java.lang.Thread.run(Thread.java:534)Few facts above the scenario is : The same SP is being called by other internal modules and its working fine for years.

From our module, the same SP is working in our testing environment. so we guess the problem could be due to some version difference in testing amp; production environment

Friends, anyone has any idea about the same?

Thanks
Srinivas

Which version of Spring are you using.  Can we see the applicationContext and the code?

mons.dbcp.BasicDataSourcequot;gt;
lt;property name=quot;driverClassNamequot;gt;
lt;valuegt;oracle.jdbc.driver.OracleDriverlt;/valuegt;
lt;/propertygt;
lt;property name=quot;uclquot;gt;
lt;valuegt;jdbcracle:thin172..x.x.x:1988:BVDB6lt;/valuegt;
lt;/propertygt;
lt;property name=quot;usernamequot;gt;
lt;valuegt;testlt;/valuegt;
lt;/propertygt;
lt;!-- Ensure the password is encrypted  --gt;
lt;property name=quot;passwordquot;gt;
lt;valuegt;aaaaaaaaaaaaaaalt;/valuegt;
lt;/propertygt;
lt;property name=quot;initialSizequot; value=quot;2quot; /gt;  lt;property name=quot;maxActivequot; value=quot;10quot; /gt;
lt;/beangt;

How about seeing the Dao that causes the problems?

public String createTransaction(Transaction transaction)   {
       logger.info(quot;createTransaction(Transaction transaction) quot; + LoggingConstants.METHODBEGIN);       if (logger.isDebugEnabled())       {logger.debug(quot;transaction :quot; + transaction);       }       try       {
Object[] debit = null;List creditsList = new ArrayList();if (transaction.getDebit() != null){    debit = transaction.getDebit().toObject();    if (logger.isDebugEnabled())    {        logger.debug(quot; Debit leg : quot; + debit);    }   for (int i = 0; i lt; debit.length; i++)        if (logger.isDebugEnabled())        {            logger.debug(quot;Debit Leg value :quot; + debit[i]);        }}
if (transaction.getCredit() != null){   if (logger.isDebugEnabled())    {        logger.debug(quot;Credit Length :quot; + transaction.getCredit().length);    }    for (int i = 0; i lt; transaction.getCredit().length; i++)    {        if (transaction.getCredit()[i] != null)        {            creditsList.add(transaction.getCredit()[i].toObject());            if (logger.isDebugEnabled())            {                logger.debug(quot; Credit leg:quot; + creditsList.get(i));            }        }    }}
SumStoredProcedure sproc = new SumStoredProcedure(getJdbcTemplate(),        DAOConstants.JAVA_RETAIL_TRANSACTION_PROCESS_TRANS  ACTION_PROCNAME);Map procResult = sproc.execute(debit, creditsList, transaction);// /if (logger.isDebugEnabled()) {logger.info(quot; reference no : quot; + (String) procResult.get(quot;p_referencenoquot;));// }
String error = (String) procResult.get(DAOConstants.P_ERROR);logger.info(quot;error#####quot; + error);if (error.equalsIgnoreCase(DAOConstants.ZERO)){    logger.info(quot;createTransaction(Transaction transaction) quot; + LoggingConstants.METHODEND);    return (String) procResult.get(DAOConstants.P_REFERENCE_NO);}else{    DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE);}
       }
       catch (DataAccessException ex)       {ex.printStackTrace();DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE, ex);       }       catch (Exception ex)       {ex.printStackTrace();logger.fatal(LoggingConstants.EXCEPTION, ex);DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE);       }       return null;   }

Can you enclose your code in [ code] [ /code] tags please, its so much easier to read.  Where is the code for SumStoredProcedure?

public class IBTransactionDAOImpl extends JdbcDaoSupport implements IBTransactionDAO {
   protected final Logger logger = Logger.getLogger(getClass());
   private ResourceBundleMessageSource transactionProperties;
   private BranchUtils branchUtils;
   public String createTransaction(Transaction transaction) {
       logger.info(quot;createTransaction(Transaction transaction) quot; + LoggingConstants.METHODBEGIN);       if (logger.isDebugEnabled()) {logger.debug(quot;transaction :quot; + transaction);       }       try {
Object[] debit = null;List creditsList = new ArrayList();if (transaction.getDebit() != null) {    debit = transaction.getDebit().toObject();    if (logger.isDebugEnabled()) {        logger.debug(quot; Debit leg : quot; + debit);    }   for (int i = 0; i lt; debit.length; i++)        if (logger.isDebugEnabled()) {            logger.debug(quot;Debit Leg value :quot; + debit[i]);        }}
if (transaction.getCredit() != null) {   if (logger.isDebugEnabled()) {        logger.debug(quot;Credit Length :quot; + transaction.getCredit().length);    }    for (int i = 0; i lt; transaction.getCredit().length; i++) {        if (transaction.getCredit()[i] != null) {            creditsList.add(transaction.getCredit()[i].toObject());            if (logger.isDebugEnabled()) {                logger.debug(quot; Credit leg:quot; + creditsList.get(i));            }        }    }}
SumStoredProcedure sproc = new SumStoredProcedure(getJdbcTemplate(),        DAOConstants.JAVA_RETAIL_TRANSACTION_PROCESS_TRANS  ACTION_PROCNAME);Map procResult = sproc.execute(debit, creditsList, transaction);///if (logger.isDebugEnabled()) {logger.info(quot; reference no : quot; + (String) procResult.get(quot;p_referencenoquot;));//}
String error = (String) procResult.get(DAOConstants.P_ERROR);if (error.equalsIgnoreCase(DAOConstants.ZERO)) {    logger.info(quot;createTransaction(Transaction transaction) quot; + LoggingConstants.METHODEND);    return (String) procResult.get(DAOConstants.P_REFERENCE_NO);}else {    DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE);}
       }
       catch (DataAccessException ex) {DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE, ex);       }       catch (Exception ex) {logger.fatal(LoggingConstants.EXCEPTION, ex);DAOException.throwException(ErrorConstants.FATAL_E  XCEPTION_ERRORCODE);       }       return null;   }private class SumStoredProcedure extends StoredProcedure {       protected final Logger logger = Logger.getLogger(getClass());
       public SumStoredProcedure(JdbcTemplate jdbcTemplate, String name) {super(jdbcTemplate, name);setSql(name);declareParameter(new SqlParameter(DAOConstants.P_DEBITLEG, OracleTypes.STRUCT,        DAOConstants.OBJ_TRANSACTIONLEG));declareParameter(new SqlParameter(DAOConstants.P_CREDITLEG, OracleTypes.ARRAY, DAOConstants.TRANSACTIONLEG));declareParameter(new SqlParameter(DAOConstants.P_TRANSACTIONNAME, OracleTypes.VARCHAR));declareParameter(new SqlParameter(DAOConstants.P_TRANSACTIONPATH, OracleTypes.VARCHAR));declareParameter(new SqlOutParameter(DAOConstants.P_REFERENCE_NO, OracleTypes.VARCHAR));declareParameter(new SqlOutParameter(DAOConstants.P_ERROR, OracleTypes.VARCHAR));compile();
       }
       public Map execute(final Object[] debit, final List creditsList, final Transaction transaction) {return execute(new ParameterMapper() {    public Map createMap(Connection conn) throws SQLException {       StructDescriptor sdesc1 = StructDescriptor.createDescriptor(DAOConstants.OBJ  _TRANSACTIONLEG, conn);        if (logger.isDebugEnabled()) {            logger.debug(quot;Create STRUCT : quot; + debit);        }        STRUCT param1 = new STRUCT(sdesc1, conn, debit);        if (logger.isDebugEnabled()) {            logger.debug(quot; Begin Credit : quot; + debit);        }       STRUCT[] objStruct = new STRUCT[creditsList.size()];        for (int i = 0; i lt; creditsList.size(); i++) {            objStruct[i] = new STRUCT(sdesc1, conn, (Object[]) creditsList.get(i));        }        ArrayDescriptor objAd = ArrayDescriptor.createDescriptor(DAOConstants.TRAN  SACTIONLEG, conn);        ARRAY array = new ARRAY(objAd, conn, objStruct);       Map params = new HashMap();        params.put(DAOConstants.P_DEBITLEG, param1);        params.put(DAOConstants.P_CREDITLEG, array);        params.put(DAOConstants.P_TRANSACTIONNAME, transaction.getName().trim());        params.put(DAOConstants.P_TRANSACTIONPATH, transaction.getPath());       return params;    }});
       }
   }

I can't seen anything obviously wrong, but then again its so hard to read without code tags.  Debug it and try to see whats causing the error.
¥
Back Forum Reply New