• Welcome to KonaKart Community Forum. Please login or sign up.
 

Order Confirmation throws StringIndexOutOfBoundsException

Started by testcase, April 01, 2009, 09:32:07 am

Previous topic - Next topic

testcase

Hi,

my KonaKart-3.2.0.0 is running on SUSE LINUX Enterprise Edition 10 Service Pack 2 (SLE-10-i386-SP2) with Apache Tomcat 5.0.30-27.35, MySQL 5.0.26-12.22 and IBM Java 1.5.0_sr7-0.2

All works fine up to now except for Order Confirmation. Gone to the cart and having  clicked on the button "Order" following debug information appears:

Exception Name = com.konakart.app.KKException
Exception Message = java.lang.StringIndexOutOfBoundsException
Exception Stack Trace =
at com.konakart.app.KKEng.sendOrderConfirmationEmail1(KKEng.java:2316)
at com.konakart.al.OrderMgr.sendOrderConfirmationEmail(OrderMgr.java:363)
at com.konakart.al.OrderMgr.saveOrder(OrderMgr.java:345)
at com.konakart.actions.CheckoutConfirmationSubmitAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:196)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:150)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:162)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:810)

Exception Cause = java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at com.konakart.bl.EmailMgr.sendOrderConfirmationEmail1(EmailMgr.java:818)
at com.konakart.app.KKEng.sendOrderConfirmationEmail1(KKEng.java:2309)
at com.konakart.al.OrderMgr.sendOrderConfirmationEmail(OrderMgr.java:363)
at com.konakart.al.OrderMgr.saveOrder(OrderMgr.java:345)
at com.konakart.actions.CheckoutConfirmationSubmitAction.execute(Unknown Source)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:196)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:150)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:162)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:810)


The order has reached the Konakart Application and can be viewed but no email has been sent.

What might be wrong? Can someone help me?

Regards

trevor

Have you changed the eMail velocity template for the order confirmation ? If so, can you post it ?

testcase

Hi!

There are just made some translations without having changed anything else.
Here is the OrderConfirmation_de.vm settled in /srv/www/tomcat5/base/webapps/konakart/WEB-INF/classes:

<html>
   <head>
      <title>Bestellbestätigung</title>
      <style type="text/css">                     
         .font {font-family: Arial, Helvetica, Sans-Serif;}
         .title{font-size: 160%;}      
         .dataCell { font-family: Arial, Helvetica, Sans-Serif; background-color: #E1E7F7 }
         .title1{font-size: 120%;}      
         .option{font-size: 80%;}      
      </style>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   </head>
   <body>
      <table border="0" width="100%" class="font">
         <tr>
            <td class="title">
               <a href="http://www.konakart.com">
                  <img src="http://www.konakart.com/images/logo.png"; border="0" alt=""/>
               </a>
            </td>
            <td class="title">
                Order Confirmation
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2" class="title1">
               $storeName
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               Order Number: $order.getId()
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               Bestelldatum: $dateTool.format('d-MMM-yyyy HH:mm:ss',$order.getDatePurchased(),$locale)
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Produkte
            </td>
         </tr>
         #foreach( $op in $order.getOrderProducts() )
         <tr>
            <td  colspan="1" nowrap="true">
               $op.getQuantity() x $op.getName()
            </td>
            <td width="100%"  colspan="1">
               $currencyMgr.formatPrice($op.getFinalPriceIncTax(),$order.getCurrencyCode())
            </td>
         </tr>
            #foreach( $option in $op.getOpts() )
            <tr>
               <td width="100%"  colspan="2" class="option">
                  &nbsp;&nbsp;-$option.getName() : $option.getValue()
               </td>
            </tr>
            #end
         #end   
      </table>   
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Totals
            </td>
         </tr>
         #foreach( $ot in $order.getOrderTotals() )
         <tr>
            <td  colspan="1" nowrap="true">
               $ot.getTitle()
            </td>
            <td width="100%"  colspan="1">
               $ot.getText()
            </td>
         </tr>
         #end
      </table>            
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Lieferadresse
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getDeliveryFormattedAddress()
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Rechnungsadresse
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getBillingFormattedAddress()
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Bezahlmethode
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getPaymentMethod()
            </td>
         </tr>
      </table>         
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Bestellverlauf
            </td>
         </tr>
         #foreach( $osh in $order.getStatusTrail() )
         <tr>
            <td width="100%"  colspan="2">
               $dateTool.format('d-MMM-yyyy HH:mm:ss',$osh.getDateAdded(),$locale) : $osh.getOrderStatus()
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $osh.getComments()
            </td>
         </tr>
         #end
      </table>         
   </body>
</html>

Thank you for help in advance.

trevor

I think that it will be using OrderConfReceived_de.vm. Have you modified that ? If so can you post it ?

testcase

Sorry!

Here is OrderConfReceived_de.vm with just some translations either:

Order Received
<html>
   <head>
      <title>Order Confirmation</title>
      <style type="text/css">                     
         .font {font-family: Arial, Helvetica, Sans-Serif;}
         .title{font-size: 160%;}      
         .dataCell { font-family: Arial, Helvetica, Sans-Serif; background-color: #E1E7F7 }
         .title1{font-size: 120%;}      
         .option{font-size: 80%;}      
      </style>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   </head>
   <body>
      <table border="0" width="100%" class="font">
         <tr>
            <td class="title">
               <a href="http://www.konakart.com">
                  <img src="http://www.konakart.com/images/logo.png"; border="0" alt=""/>
               </a>
            </td>
            <td class="title">
                Bestellbestätigung
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%">
               Lieber $customer.getFirstName() $customer.getLastName(),<br><br>Hiermit bestätigen wir den Eingang Ihrer Bestellung.<br><br>Ihre Bestellung umfaßt folgende Posten:
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2" class="title1">
               $storeName
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               Bestellnr.: $order.getId()
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               Bestelldatum: $dateTool.format('d-MMM-yyyy HH:mm:ss',$order.getDatePurchased(),$locale)
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Produkte
            </td>
         </tr>
         #foreach( $op in $order.getOrderProducts() )
         <tr>
            <td  colspan="1" nowrap="true">
               $op.getQuantity() x $op.getName()
            </td>
            <td width="100%"  colspan="1">
               $currencyMgr.formatPrice($op.getFinalPriceIncTax(),$order.getCurrencyCode())
            </td>
         </tr>
            #foreach( $option in $op.getOpts() )
            <tr>
               <td width="100%"  colspan="2" class="option">
                  &nbsp;&nbsp;-$option.getName() : $option.getValue()
               </td>
            </tr>
            #end
         #end   
      </table>   
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Totals
            </td>
         </tr>
         #foreach( $ot in $order.getOrderTotals() )
         <tr>
            <td  colspan="1" nowrap="true">
               $ot.getTitle()
            </td>
            <td width="100%"  colspan="1">
               $ot.getText()
            </td>
         </tr>
         #end
      </table>            
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Lieferadresse
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getDeliveryFormattedAddress()
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Rechnungsadresse
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getBillingFormattedAddress()
            </td>
         </tr>
      </table>
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Bezahlmethode
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $order.getPaymentMethod()
            </td>
         </tr>
      </table>         
      <table border="0" width="100%" class="dataCell">
         <tr>
            <td width="100%"  colspan="2">
               &nbsp;
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2" class="title1">
               Bestellverlauf
            </td>
         </tr>
         #foreach( $osh in $order.getStatusTrail() )
         <tr>
            <td width="100%"  colspan="2">
               $dateTool.format('d-MMM-yyyy HH:mm:ss',$osh.getDateAdded(),$locale) : $osh.getOrderStatus()
            </td>
         </tr>
         <tr>
            <td width="100%"  colspan="2">
               $osh.getComments()
            </td>
         </tr>
         #end
      </table>         
   </body>
</html>


trevor

At a first glance that looks OK. The exception would seem to point to the problem being that there is no eMail subject line (i.e. The Order Received text before the first <html> tag).





testcase

Hi trevor,

thank you very much for your hint at OrderConfReceived_de.vm!

I have substituted OrderConfReceived_de.vm by a renamed OrderConfReceived_en.vm and now it works! There must have been an error in my german email velocity template version.

And, for information, herewith it is proven that Konakart works with IBM Java 1.5.0 (as delivered in SLES 10 SP2), not only with Sun Java 1.5! I just added JSSE 1.03_4 from Sun. Also Tomcat 5 and MySQL 5 as delivered in SLES10 SP2 can be used.

Best regards,
happy user

trevor