Commerce Server Blog

Build world class ecommerce applications using Microsoft Commerce Server
  •  
  • Home
  • Advertise
  • Copyright Policy
  • Disclaimer
  • About

Troubleshoot: Configuration specifies useSharedCommerceContexts=true. Contexts cannot be requested for other Commerce Server sites.

ravikanth | May 14, 2010

Today, I got latest code from TFS and setup my application. When I execute the application I got wired error.

An exception of type ‘Microsoft.Commerce.Providers.Exceptions.ContextCreationException’ occurred and was caught.
————————————————————————————————-
Type : Microsoft.Commerce.Providers.Exceptions.ContextCreationException, Microsoft.Commerce.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Message : Configuration specifies useSharedCommerceContexts=true. Contexts cannot be requested for other Commerce Server sites.
Source : Microsoft.Commerce.Providers
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Microsoft.CommerceServer.Catalog.CatalogContext get_Item(System.String)
Stack Trace : at Microsoft.Commerce.Providers.ContextProviders.Shared.CatalogContextProvider.get_Item(String siteName)
at Microsoft.Commerce.Providers.Metadata.CatalogMetadataProvider..ctor(String siteName)
at Microsoft.Commerce.Providers.Metadata.CatalogMetadataLoader.GetSubsystemMetadata(String siteName)
………………………….
………………………….
………………………….

I have only one commerce server site configured in my application and from frontend configuration, I can’t connect to another commerce server in different machine (currently CS and MOSS are hug and can’t work from different machines). After troubleshooting further, I found that it is due to the case sensitive of site name in channelconfiguration file. The CS site created on my desktop is “SiteName” and the site name in channel configuration file is “Sitename”. After changing the site name, the application started working fine.

Even though the fix is simple but would like to keep it in my blog so that fellow developers (like me) will not waste their time much in fixing this simple issue.

Comments
1 Comment »
Categories
Commerce Server 2009, Troubleshoot
Comments rss Comments rss
Trackback Trackback

Exception Handling in CS2009

ravikanth | May 4, 2010

There are no specific exception handling guidelines for CS2009. Through CS foundation (operation sequence components), we are calling different the services which performs some action and returns few validation exceptions for invalid data or conditions. We thought of creating custom exception class for each type of validation message so that the client application can react accordingly. Below diagram shows the high level architecture of exception handling across layers.

Exception Handling - beginning

The implementation went smooth but the real problem came when we try to test the code. We are getting fault exception from the service and can be able to catch it properly in operation sequence components but when the control goes from operation sequence components to app layer the exception is converted as Generic exception. Not sure, where is the problem is and why the exception is converted back to generic exception. After troubleshoot further and digging through CS2009 code with reflector, I found that commerce server broker is catching all exceptions and converting to generic exceptions (except fault exceptions). Check below image for more details.

CS2009 ProcessRequest

I feel, Microsoft feels it may be security issue of sending back all (external or internal) exceptions back to calling program and that might be the reason for suppressing all exceptions except fault exception. I have to changed my application architecture and now I am bringing fault exceptions and handling them in controller or presenter level which is still satisfying my requirement.

Exception Handling -CS2009

Comments
No Comments »
Categories
Commerce Server 2009
Comments rss Comments rss
Trackback Trackback

Sign up for Newsletter


Categories

Quiz

  • Catalog Quiz for Beginners
  • Profile Quiz for Beginners
  • Quiz 1 for Advance Users
  • Quiz for Beginners

Recent Posts

  • Staging Deployment – Security Considerations
  • Pipeline Editor displays registered custom pipeline components as unknown in 64 Bit version.
  • How commerce server staging works
  • Steps to extend payments in Commerce Server 2009
  • Introduction to Commerce Server Staging
  • Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information
  • Commerce server staging throws Remote authorization failed to server. Ensure the service has access to this server.
  • Updated Commerce Server 2009 template pack for SharePoint 2007 released
  • RCXml2Resx.exe tool stops working
  • Commerce Server Profile Importer Tool

Archives

  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008

Tags

add discounts add images to profile Advantages of commerce server approve discounts authentication auto login process automatic user creation basket Brand Management business tools campaign management Catalog catalog import Category commerce server commerce server 2007 commerce server manager Commerce Server SP2 commerce server staging discounts ecommerce Estimation Installation inventory Kanth Koppala marketing system migration error Mojave operation components operation sequence Order subsystem Product profile profile subsystem property metadata purchase order quick checkout Ravi Ravi Kanth site cache refresh starter site tools transactions error Variant
(c) 2009 Commerce Server Blog. All rights Reserved. Articles cannot be reproduced without permission from the author.Write to me at kanth@ravikanth.net if you have any comments, questions, suggestions about this site or would like to send us a tip
About Us | Terms of Use | Disclaimer | Advertise .