Archive for June 2010

By default, when you install commerce server 2009, a help document (CHM) is created in your local machine. This document has lot of useful information on CS2009/CS2007. One of the disadvantage of this is that you can’t move this document to another machine. Finbar Ryan (MS CS support team) has created a CHM file using PackageThis tool. I thought of sharing the same to the commerce community so that people can start learning commerce server without installing the software. Thanks Finbar for sharing this document to the community. Click below icon to download the file.

 

image

image

Related Articles


If you like this post, please click on our sponsor advertisement.


At last, my waiting has come to an end when Microsoft has released commerce server 2009 template pack for SharePoint 2010 this week end (17th June 2010). With new CTP R2 and with manual deployment of R2, we can able to make the application work on SPS2010 with no errors.

What this template pack, we get following things

  • Default OOB site with new look and feel (green, grey, etc ).
  • Site can work on desktop browsers or mobile browsers (windows mobile, Iphone).
  • Working code on SharePoint 2010 and support deployment in SPS2010 or SharePoint foundation 2010 environment.
  • Supports only in windows 2008 or windows 2008 R2 operating systems.
  • Partners SDK – can extend code to create new websites.

After installing the application, here is how it looks.

clip_image001

image

You can download this template pack from Microsoft site and the url is http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=cfd0c459-5a11-4de6-9085-52d59e8d38e6

If this product got released four months before then I would have got a chance to work sps2010 but doesn’t matter, hope I get another opportunity soon to work on SPS2010. In next few weeks, I will start exploring the software and post my observations in this blog. So, stay tuned.

Related Articles


If you like this post, please click on our sponsor advertisement.


For past few days, the below exception has taken away my sleep. This error occurs in our pre-prod environment and it is totally unpredictable. You may get or may not get with the same data. Profile registration is first page to any ecommerce application and as it is failing here and as usual everyone swords are towards me for the fix.

An exception of type ‘Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileSystemException’ occurred and was caught.

————————————————————————————————————————
06/15/2010 03:58:49
Type : Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileSystemException, Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35\
Message : Failed to set value for profile property ‘email_address’.
Source : Microsoft.CommerceServer.Runtime
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void set_Value(System.Object)
Stack Trace : at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value)
at Microsoft.Commerce.Providers.Translators.ProfileTranslatorBase.SetProperty(Profile destinationObject, String propertyName, Object propertyValue)
at Microsoft.Commerce.Providers.Translators.ProfileTranslatorBase.TranslateInternal(CommerceEntity sourceObject, Profile destinationObject, CommercePropertyCollection propertiesToReturn)
at Microsoft.Commerce.Providers.Translators.UserProfileTranslator.Translate(CommerceEntity sourceCommerceEntity, Object destinationObject)
at Microsoft.Commerce.Providers.Translators.Translator.ToExternalEntity(CommerceEntity sourceCommerceEntity, Object destinationType)
at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.Update(IEnumerable`1 commerceProfileList, CommerceEntity operationModel)
at Microsoft.Commerce.Providers.Components.ProfileCommitterBase.ExecuteUpdate(CommerceUpdateOperation updateOperation, OperationCacheDictionary operationCache, CommerceUpdateOperationResponse response)
at Microsoft.Commerce.Providers.Components.OperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Providers.Components.ProfileOperationSequenceComponent.Execute(CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Broker.OperationSequence.ExecuteComponentTree(List`1 executionTreeList, CommerceOperation operation, OperationCacheDictionary operationCache, CommerceOperationResponse response)
at Microsoft.Commerce.Broker.OperationSequence.Execute(CommerceOperation operation)
at Microsoft.Commerce.Broker.MessageHandler.ProcessMessage(String messageHandlerName, CommerceOperation operation)
at Microsoft.Commerce.Broker.OperationService.InternalProcessRequest(CommerceRequest request)
at Microsoft.Commerce.Broker.OperationService.ProcessRequest(CommerceRequest request)

Since the error is happening in translator, I suspect that I am passing wrong data to the commerce server. I verified that user_id (guid) and email address are sent from controller class. I google or binged but no luck.

Missile trigger happens at one place and damage at another place. This problem comes under same category. Everybody sees this as commerce server exception as below error found in event log with lot of “commerce” words. After lot of efforts, I found that the error is due to assigning to wrong GUID and email_ID. For example, consider following data.

user_ID email ID
Guid1 user1@test.com
Guid2 user2@test.com

First I sign-in with user 1 and both user_id and email_id are stored in cookie. I press sign-out email_id is removed from cookie but not user_id. The second time, I logged in with user2 now this time, the user 2 email_id is keep in cookie but  its GUID is not updated (as the old object already exist in the cookie). When I try to save user profile, I am passing GUID1 and user2@test.com to commerce server and it is throwing exception as the update operation tries to update row 1 with user2@test.com in email_id field (which is a unique key).

Related Articles


If you like this post, please click on our sponsor advertisement.


After successful application deployment in pre-production environment and when I ran the application start page, I got below exception. We shouted “Not Again”… setting up of CS2009 application is not a simple task and automating the installation is a nightmare (as usual, we doubted our installation tool for not installing the application correctly). The exception is wired and we are not able to figure out why the error has occurred?

An exception of type ‘System.ArgumentException’ occurred and was caught.
————————————————————————
06/12/2010 05:22:20
Type : System.ArgumentException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : An item with the same key has already been added.
Source : mscorlib
Help link :
ParamName :
Data : System.Collections.ListDictionaryInternal
TargetSite : Void ThrowArgumentException(System.ExceptionResource)
Stack Trace :    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Microsoft.Commerce.Application.Common.Configuration.ServiceConfiguration.CreateDictionary(String channelName)
   at Microsoft.Commerce.Application.Common.Configuration.ServiceConfiguration.GetSiteName(String channel)
   at Microsoft.Commerce.Broker.OperationService.InitializeOperationContext(CommerceRequest request)
   at Microsoft.Commerce.Broker.OperationService.ProcessRequest(CommerceRequest request)

CS2009 exceptions are not user friendly. You need more troubleshooting skills to see what is the problem and where exactly to tweak to make the application work. Since our site is running on variations (to support multiple languages), I had make sure that our site channel configuration is pointed to correct values.

To troubleshoot these kind of errors, I suggest every CS2009 developer to download Reflector tool. This tool will help us see how the assembly code has written and what values it is expecting and on which condition it is throwing certain exception. After troubleshooting further, I came to know that the old site is not deleted which is currently pointing to same commerce server site and running in same application pool. After stopping the old site, my site started working. Seems CS2009 is adding the site name to a dictionary and it is throwing “An item with the same key has already been added.“exception as the site name was already entered by the first site into the dictionary.

Same error hits back again:

After few days,  I started getting same error on production. Hurry, time to sleepless nights :) . I have verified whether channel configuration is correct and no duplicates. Finally, I peeped into product code using reflector. I could see and feels that when the channel name (CommerceRequest. RequestContext().Channel())comes as empty/null even though the channel name exists in config section/list.

Silly thing is that in one method they are checking for not null in one method

clip_image001

try to add the default value (Default_GUID) in another method.

clip_image001[4]

 

Think of the situation where you didn’t mentioned channel name or somehow commerce server didn’t get channel name.

  • On first request, since we are getting emplty value, we are calling CreateDictionary method to add default channel name to the list(everything is fine till this point).
  • For the next time if we gets empty config value null, we are once again trying to check the value for null and without checking whether default channel (Default_guid) already exist in list , we are trying to add it default_GUID value, which is triggering the value.

The remedy I followed (which worked) is hardcoded channel name in the code.

context.Channel = "Default";
context.UserLocale = SPContext.Current.Web.Locale.ToString();

context.UserUILocale = SPContext.Current.Web.Locale.ToString();

context.RequestId = Guid.NewGuid().ToString("B");

Related Articles


If you like this post, please click on our sponsor advertisement.


During code development, some strange things happens and in routine, we will start blaming commerce server for not working. The same thing happened when we run basket pipeline after adding a product to the basket. Basket pipeline component has removed the newly added produce and written below error message in the log

Please note that one or more items were removed from your order because the product is no longer sold”.

As usual, by seeing the error message in the log, we started looking whether inventory for that product is over. Later we have disabled the inventory and at last we have remove the mapping of inventory catalog and product catalog. After some troubleshooting we found that the item we are adding into the basket is a product family and we are setting product ID in the line item but not the variant ID. A simple miss has created a big mess :) . So, friends, if you have seen such error either check for inventory or check if you are passing correct values to the line item.

Related Articles


If you like this post, please click on our sponsor advertisement.


Follow me on Google+
Add to circles

In 0 people's circles

Sign up for Newsletter