Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Jason Mackay 98 posts 149 karma points
    Feb 08, 2012 @ 11:30
    Jason Mackay
    0

    Error in Ucommerce

    Hey, 

    I noticed this morning that my submitBasket[XSLT] was throwing an error, it might have been something I did yesterday but from the error message I cannot see where it would have come from as I havent done anything with the pipelines. Do you have an ideas?

    System.Xml.Xsl.XslTransformException was unhandled by user code
      Message=An error occurred during a call to extension function 'Checkout'. See InnerException for a complete description of the error.
      Source=System.Data.SqlXml
      LineNumber=0
      LinePosition=0
      StackTrace:
           at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
           at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
           at System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) in C:\Projects\uCommerceDemo\xslt\SubmitBasket[XSLT].xslt:line 22
           at System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
           at System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
           at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
           at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
           at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
           at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
           at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
           at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
           at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)
      InnerException: UCommerce.Pipelines.PipelineException
           Message=Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. See inner exception for details.
           Source=UCommerce
           StackTrace:
                at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
                at UCommerce.Transactions.CheckoutService.Checkout(Basket basket)
                at UCommerce.Xslt.TransactionLibrary.Checkout()
                at UCommerce.Xslt.Library.<Checkout>b__88()
                at UCommerce.Xslt.Library.HandledCall[T](Func`1 method)
                at UCommerce.Xslt.Library.Checkout()
           InnerException: System.InvalidOperationException
                Message=Sequence contains more than one element
                Source=NHibernate
                StackTrace:
                     at NHibernate.Linq.NhQueryProvider.ExecuteQuery(NhLinqExpression nhLinqExpression, IQuery query, NhLinqExpression nhQuery)
                     at NHibernate.Linq.NhQueryProvider.Execute[TResult](Expression expression)
                     at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
                     at UCommerce.EntitiesV2.Repository`1.SingleOrDefault(Expression`1 expression)
                     at UCommerce.Pipelines.Checkout.CreateCustomerTask.Execute(PurchaseOrder purchaseOrder)
                     at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
                InnerException: 

    Thanks

    Jason

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 10, 2012 @ 12:53
    Søren Spelling Lund
    0

    Hi Jason,

    The issues is caused by the fact that there are more objects than assumed present in a collection. Basically there are a bunch of of "Single" or "SingleOrDefault" calls littered around the code. They assume that only one element and zero or one element are returned respectively. If there are more an exceptionn is thrown as you're seeing.

    Are you running with the default pipeline tasks only or did you add some custom ones yourself? If they're the default I'd like to see your current dataset and see if uCommerce should handle the situation.

  • Jason Mackay 98 posts 149 karma points
    Feb 10, 2012 @ 13:07
    Jason Mackay
    0

    Hi Soren

    Thanks for the reply, we added one more custom pipeline in addition to this. As we dont want the system to go to a payment system and just need an email sent out once purchased.

    The additional pipeline looks like : 

    <component id="Checkout.SendConfirmationEmail"

              service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"

              type="UCommerce.Pipelines.Common.SendEmailTask, UCommerce.Pipelines"

              lifestyle="Thread">

    Could this be a problem? It was working perfectly before hand.

    Thanks

    Jason

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 13, 2012 @ 14:33
    Søren Spelling Lund
    0

    Try commenting that component out and see if you have better luck.

    The component you posted is that the one you added? You should be able to add as many instances of it as you want as long as you keep the IDs unique.

  • Jason Mackay 98 posts 149 karma points
    Feb 13, 2012 @ 14:37
    Jason Mackay
    0

    Hi Soren,

    I have tried that and tried changing the pipelines, but nothing seems to change, goes through the whole process but doesn't reset the checkout and doesnt add a completed order to the database like it did before.

    Jason

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 13, 2012 @ 15:26
    Søren Spelling Lund
    0

    Could you send me the database with repro steps via e-mail? I'll take a look. ssl AT ucommerce DOT dk.

  • Jason Mackay 98 posts 149 karma points
    Feb 13, 2012 @ 16:39
    Jason Mackay
    0

    Hi Soren,

    It seems that my colleague can go through the whole process through my local server and it saves the order, but not on my machine. I might try and put this on another server and see if this has any effect on it. If not I'll send you the DB.

    Jason

  • Søren Spelling Lund 1797 posts 2786 karma points
    Feb 14, 2012 @ 10:43
    Søren Spelling Lund
    0

    It might be your local basket that's screwed up somehow. You can try resetting the cookies for your test doman to get uCommerce to assign you a new one.

Please Sign in or register to post replies

Write your reply to:

Draft