Wednesday, February 10, 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;
            }
        }