Tuesday, July 13, 2010

An exception of type 'Microsoft.CommerceServer.Catalog.ValidationException' occurred and was caught Commerce server


This error occurred when catalog name is null or empty 
To fix  This follow these steps 
1.       Find sessionstate tag in  the web.config 
By default it is 20 min increase to 60 min (Depends on requirement )
  timeout=”60”/>

2.       If your maintaining catalog name in session level  .Provide default catalog name if session expire
 Ex :
 public string SessionCatalogName
        {
            get
            {
                if (HttpContext.Current.Session[APConstants.SessionVariables.CatalogName] != null)
                {
                    return HttpContext.Current.Session[APConstants.SessionVariables.CatalogName].ToString();
                }
                else
                {      return APConstants.ApplicationParameters.GKDefaultCatalogName;
                }
            }
            set
            {
                HttpContext.Current.Session[ApConstants.SessionVariables.CatalogName] = value;
            }
        }

2 comments:

Praksh said...

which is the better way to maintain default catalog if session expires?

Srinivas said...

There are two ways to maintain a
Default catalog

1. keeping in web.config

2. Maintain in as a constant

Depends on requirement you need to maintain it

Please free to ask if any clarification