Archive for May 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.

Related Articles


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


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

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