| Author |
Message |
David Abitbol
Guest
|
Posted:
Thu Oct 27, 2005 8:51 pm Post subject:
Invalid Cast Exception retreiving site terms |
|
|
Hi everybody,
We have a website running on Commerce Server 2002 SP1. I have a page trying
to retrieve the site term names using:
ArrayList al = CommerceContext.Current.ProfileSystem.SiteTermNames;
Commerce comes with an invalid cast exception on this line. We believe it's
a problem with the server, we tried profiling the sql queries but nothing
seems to give us an idea of what's going on.
Thank you. |
|
| Back to top |
|
 |
Zoe Hart [MVP]
Guest
|
Posted:
Thu Oct 27, 2005 8:51 pm Post subject:
Re: Invalid Cast Exception retreiving site terms |
|
|
That line executes without error on my system. Can you provide the stack
trace to see where the error is actually occurring? Is it in your code or
somewhere in Commerce Server code?
--
Zoe Hart
Commerce Server MVP |
|
| Back to top |
|
 |
David Abitbol
Guest
|
Posted:
Fri Oct 28, 2005 12:51 am Post subject:
Re: Invalid Cast Exception retreiving site terms |
|
|
There you go as you can see it is in commerce server code:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.InvalidCastException: ?
Source Error:
Line 27: catch (Exception exc)
Line 28: {
Line 29: throw exc;
Line 30: }
Line 31:
Source File:
D:\Inetpub\FTProot\BraultMartineau\www\BraultMartineau\TestPages\TestSiteTerms.aspx Line: 29
Stack Trace:
[InvalidCastException: ?]
Microsoft.CommerceServer.Interop.Profiles.SharedFns2.GetProfileShared(Connection& connBizDataStore, String& sProfilePath, String sEncode) +661
Microsoft.CommerceServer.Interop.Profiles.BusinessDataAdmin2FreeThreaded.GetSiteTerms(String sEncode) +62
[CommerceException: ?]
ASP.TestSiteTerms_aspx.Page_Load(Object sender, EventArgs e) in
D:\Inetpub\FTProot\BraultMartineau\www\BraultMartineau\TestPages\TestSiteTerms.aspx:29
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +733 |
|
| Back to top |
|
 |
Zoe Hart [MVP]
Guest
|
Posted:
Fri Oct 28, 2005 4:51 pm Post subject:
Re: Invalid Cast Exception retreiving site terms |
|
|
I'll be honest, I'm just shooting in the dark now. It seems like there's
either something wrong with your installation (bad/corrupt CS code) or
there's something funky about your site terms. Does this happen on more than
one machine? If so, that would point away from the bad installation theory.
You could unpack a blank Commerce site and try the code there. If it runs
OK, the install is OK and it's probably something in the data. From there
you could try adding your custom site terms to the blank site to see if/when
the problem starts or removing them (after backing up your database) from
your site to see if/when the problem goes away.
--
Zoe Hart
Commerce Server MVP |
|
| Back to top |
|
 |
|
|
|
|