Discussion:
error during search in solution site code I can't figure out
(too old to reply)
Devin
2006-01-14 19:36:02 UTC
Permalink
Using the CS2002StarterSite

The search worked when we initially deployed and began developement. Since
then, it seems something has changed and the search errors on the actual
SearchContext.Current.SearchProvider.Search() method with the following error
(I commented out the try block to expose the error):

Specified cast is not valid.

SearchResults.aspx

Stack:
[InvalidCastException: Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1029

[FrameworkException: The following exception occurred in the Commerce Server
search provider:Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1500
Microsoft.Solutions.Applications.SearchResults.DoSearch() in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:617
Microsoft.Solutions.Applications.SearchResults.OnSearch(Object sender,
EventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:788
Microsoft.Solutions.Applications.SearchControl.OnSearchClick(Object o,
CommandEventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\usercontrols\searchcontrol.ascx.cs:210
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +110

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +116
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1262

Without access to that code, I can't figure out why its failing. Comparing
to the original code, teh only thing I can figure out that has changed is
that now we are searching a single catalog rather than "All catalogs".

Does anyone have any ideas what could be causing the search to fail?
Jamie
2006-02-03 20:00:42 UTC
Permalink
I am also receiving the same error. Same situation has occured for me as the
only change I have made is to remove the "All catalogs" option from the
drop-down list. If I find something I will let you know.
Post by Devin
Using the CS2002StarterSite
The search worked when we initially deployed and began developement. Since
then, it seems something has changed and the search errors on the actual
SearchContext.Current.SearchProvider.Search() method with the following error
Specified cast is not valid.
SearchResults.aspx
[InvalidCastException: Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1029
[FrameworkException: The following exception occurred in the Commerce Server
search provider:Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1500
Microsoft.Solutions.Applications.SearchResults.DoSearch() in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:617
Microsoft.Solutions.Applications.SearchResults.OnSearch(Object sender,
EventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:788
Microsoft.Solutions.Applications.SearchControl.OnSearchClick(Object o,
CommandEventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\usercontrols\searchcontrol.ascx.cs:210
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +116
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1262
Without access to that code, I can't figure out why its failing. Comparing
to the original code, teh only thing I can figure out that has changed is
that now we are searching a single catalog rather than "All catalogs".
Does anyone have any ideas what could be causing the search to fail?
Devin
2006-02-03 20:13:27 UTC
Permalink
Actually I figured this out in my cataglog I had a couple of parts with null
descriptions. The DB table is confgured to allow nulls but I guess the site
search doesn't handle them properly. I traced it back to an product import
we did, I don't think the catalog manager application will do this.

The descriptions are stored in the <catalog_name>_<culture>_catalog table
rather than the catalog products table and I found mine with the following
SQL statement. The Category descriptions are in there also but a null
description for them seems to be OK which is probably why the table allows it.

select * from

[<catalogname>_<culture>_Catalog]

where

[description] is null

and ([name] is not null and displayname is not null)


Hope that helps, i know it took me a few days to figure this one out.
Post by Jamie
I am also receiving the same error. Same situation has occured for me as the
only change I have made is to remove the "All catalogs" option from the
drop-down list. If I find something I will let you know.
Post by Devin
Using the CS2002StarterSite
The search worked when we initially deployed and began developement. Since
then, it seems something has changed and the search errors on the actual
SearchContext.Current.SearchProvider.Search() method with the following error
Specified cast is not valid.
SearchResults.aspx
[InvalidCastException: Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1029
[FrameworkException: The following exception occurred in the Commerce Server
search provider:Specified cast is not valid.]
Microsoft.Solutions.Framework.CommerceSearchProvider.Search() +1500
Microsoft.Solutions.Applications.SearchResults.DoSearch() in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:617
Microsoft.Solutions.Applications.SearchResults.OnSearch(Object sender,
EventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\searchresults.aspx.cs:788
Microsoft.Solutions.Applications.SearchControl.OnSearchClick(Object o,
CommandEventArgs e) in
\\alpharetta-dev\wwwroot\cs2002startersite\usercontrols\searchcontrol.ascx.cs:210
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +116
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1262
Without access to that code, I can't figure out why its failing. Comparing
to the original code, teh only thing I can figure out that has changed is
that now we are searching a single catalog rather than "All catalogs".
Does anyone have any ideas what could be causing the search to fail?
Loading...