Discussion:
CS 2k2 Retal Site Exception
(too old to reply)
Branimir Giurov
2005-01-10 14:09:02 UTC
Permalink
Hi there,

I have a problem with the default installation of CS2k2's Retail solution
site. When I open the solution, build it, and then add an item to my cart I
recieve the following exception:

Application uses a value of the wrong type for the current operation.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Application
uses a value of the wrong type for the current operation.

Source Error:


Line 165:
Line 166:
Line 167: Cart.Save()
Line 168: End If
Line 169: End If


Source File:
C:\Inetpub\wwwroot\retail2002\Controls\Transactions\TxContext.vb Line: 167

Stack Trace:


[COMException (0x800a0d5d):
Application uses a value of the wrong type for the current operation.]
Microsoft.CommerceServer.Interop.Orders.DBStorageClass.InsertData(Object
vtReserved, Object pdispData) +0

Microsoft.CommerceServer.Interop.Orders.MTSHelperImpl.SaveDictToTable(Int16&
bExists, IDictionary& dict, String& table, String& key, Object& exception,
Object& exception2, DBStorage& dbs, Boolean& bReinitializeDBS, String&
SavePrefix, String& dsn, String& userid)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveFlat(LoadedFromState my_save_to)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveAsBasket()

[CommerceException: SaveAsBasket Failed.]

Microsoft.CommerceServer.Internal.Common.Util.ThrowCommerceException(String
message, Exception inner, String source)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveAsBasket()
Microsoft.CommerceServer.Runtime.Orders.Basket.Save()

[CommerceOrderSystemException: Failed to save basket state to underlying
stores.]
Microsoft.CommerceServer.Runtime.Orders.Basket.Save()

Microsoft.CommerceServer.Site.Transactions.TransactionContext.get_CartOrderForm() in C:\Inetpub\wwwroot\retail2002\Controls\Transactions\TxContext.vb:167

Microsoft.CommerceServer.Site.Transactions.AddToCart.Submit_Clicked(Object
sender, EventArgs e) in
C:\Inetpub\wwwroot\retail2002\Controls\Transactions\AddToCart.ascx.vb:253
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

We're using XP SP2 and CS2k2 with SP2 and FP1.
Any ideas about the cause of the exception and how to avoid it?

Cheers,
Branimir
Nihit Kaul [MSFT]
2005-07-01 21:23:58 UTC
Permalink
Hi Branimir,

This could potentially be due to your adding a non-serializable object as a
weakly-typed property (String indexer) on one of the Basket child classes.

For e.g. if you have something like:
myCart.OrderForms[0].LineItems[0]["myBusinessObject"] =
myBusinessLogicObjectInstance;

where the variable myBusinessLogicObjectInstance is not serializable.

Thanks,

Nihit Kaul[MSFT]
Commerce Server
http://blogs.msdn.com/nihitk

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
Thread-Topic: CS 2k2 Retal Site Exception
thread-index: AcT3He/iyGvzVU0DRN6EZO8K0l+LWA==
X-WBNR-Posting-Host: 195.24.43.250
From: =?Utf-8?B?QnJhbmltaXIgR2l1cm92?=
<***@discussions.microsoft.com>
Subject: CS 2k2 Retal Site Exception
Date: Mon, 10 Jan 2005 06:09:02 -0800
Lines: 74
Message-ID: <D52A4AD8-5AD9-41D6-A236-***@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.solutionsites
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.solutionsites:6072
X-Tomcat-NG: microsoft.public.commerceserver.solutionsites

Hi there,

I have a problem with the default installation of CS2k2's Retail solution
site. When I open the solution, build it, and then add an item to my cart
I
recieve the following exception:

Application uses a value of the wrong type for the current operation.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about
the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Application
uses a value of the wrong type for the current operation.

Source Error:


Line 165:
Line 166:
Line 167: Cart.Save()
Line 168: End If
Line 169: End If


Source File:
C:\Inetpub\wwwroot\retail2002\Controls\Transactions\TxContext.vb Line:
167

Stack Trace:


[COMException (0x800a0d5d):
Application uses a value of the wrong type for the current operation.]
Microsoft.CommerceServer.Interop.Orders.DBStorageClass.InsertData(Object
vtReserved, Object pdispData) +0

Microsoft.CommerceServer.Interop.Orders.MTSHelperImpl.SaveDictToTable(Int16&

bExists, IDictionary& dict, String& table, String& key, Object& exception,
Object& exception2, DBStorage& dbs, Boolean& bReinitializeDBS, String&
SavePrefix, String& dsn, String& userid)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveFlat(Load
edFromState my_save_to)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveAsBasket(
)

[CommerceException: SaveAsBasket Failed.]

Microsoft.CommerceServer.Internal.Common.Util.ThrowCommerceException(String
message, Exception inner, String source)

Microsoft.CommerceServer.Interop.Orders.OrderGroupFreeThreaded.SaveAsBasket(
)
Microsoft.CommerceServer.Runtime.Orders.Basket.Save()

[CommerceOrderSystemException: Failed to save basket state to underlying
stores.]
Microsoft.CommerceServer.Runtime.Orders.Basket.Save()

Microsoft.CommerceServer.Site.Transactions.TransactionContext.get_CartOrderF
orm() in
C:\Inetpub\wwwroot\retail2002\Controls\Transactions\TxContext.vb:167

Microsoft.CommerceServer.Site.Transactions.AddToCart.Submit_Clicked(Object
sender, EventArgs e) in
C:\Inetpub\wwwroot\retail2002\Controls\Transactions\AddToCart.ascx.vb:253
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()

We're using XP SP2 and CS2k2 with SP2 and FP1.
Any ideas about the cause of the exception and how to avoid it?

Cheers,
Branimir

Loading...