Commerce Server General - Invalid Cast Exception retreiving site terms

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > October 2005 > Invalid Cast Exception retreiving site terms





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Invalid Cast Exception retreiving site terms
David Abitbol

2005-10-28, 4:58 pm

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.

Zoe Hart [MVP]

2005-10-28, 4:58 pm

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

"David Abitbol" <DavidAbitbol@discussions.microsoft.com> wrote in message
news:EAECA2BF-D697-4520-B09A-007830336236@microsoft.com...
> 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.
>



David Abitbol

2005-10-28, 4:58 pm

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\B
raultMartineau\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\B
raultMartineau\TestPages\TestSiteTerms.aspx:29
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +733




--------------------------------------------------------------------------------


"Zoe Hart [MVP]" wrote:

> 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
>
> "David Abitbol" <DavidAbitbol@discussions.microsoft.com> wrote in message
> news:EAECA2BF-D697-4520-B09A-007830336236@microsoft.com...
>
>
>

Zoe Hart [MVP]

2005-10-28, 4:58 pm

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

"David Abitbol" <DavidAbitbol@discussions.microsoft.com> wrote in message
news:90C990B6-D8B6-48A6-BA12-D2123E10B539@microsoft.com...[vbcol=seagreen]
> 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\B
raultMartineau\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\B
raultMartineau\TestPages\TestSiteTerms.aspx:29
> System.Web.UI.Control.OnLoad(EventArgs e) +67
> System.Web.UI.Control.LoadRecursive() +35
> System.Web.UI.Page.ProcessRequestMain() +733
>
>
>
>
> --------------------------------------------------------------------------------
>
>
> "Zoe Hart [MVP]" wrote:
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com