PDA

View Full Version : [FIXED] [V0.7] Menu Exception



Timothy
Dec 02, 2008, 1:12 PM
Hello,

Good to be back online, here is an example of the issue:

Exception received: Unable to cast object of type 'Coolite.Ext.Web.Menu' to type 'Coolite.Ext.Web.Component'.

Example.aspx:


<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True" />
<ext:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" />

<ext:SplitButton ID="Button11" runat="server" Text="Text">
<Menu>
<ext:Menu ID="Menu2" runat="server">
<Items>
<ext:MenuItem ID="MenuItem4" runat="server" Text="Item 1" Icon="GroupAdd" />
<ext:MenuItem ID="MenuItem5" runat="server" Text="Item 2" Icon="GroupDelete" />
<ext:MenuItem ID="MenuItem6" runat="server" Text="Item 3" Icon="GroupEdit" />
</Items>
</ext:Menu>
</Menu>
</ext:SplitButton>


</form>
</body>
</html>



Load page, immediate exception.

Cheers,
Timothy

geoffrey.mcgill
Dec 02, 2008, 1:22 PM
Hi Timothy,

Welcome back.


What are your system specs? running 32-bit or 64bit system? IIS6 or IIS7 (or other)?


There was another similar report, although we have yet to reproduce, see http://forums.ext.net/showthread.php?threadid=4631-16-1.aspx


We're on this. 

Timothy
Dec 02, 2008, 1:24 PM
Hello Geoffrey,

Weird question to ask; but I'm on a 32-bit with Microsoft Windows XP Professional with IIS5.0 ;)

Cheers,
Timothy

Vladimir
Dec 02, 2008, 1:27 PM
Hi Timothy,

Can you tell me what source file and what line the exception occurs?

Timothy
Dec 02, 2008, 1:29 PM
Here is the entire stack:



Server Error in '/' Application.
Unable to cast object of type 'Coolite.Ext.Web.Menu' to type 'Coolite.Ext.Web.Component'.
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: Unable to cast object of type 'Coolite.Ext.Web.Menu' to type 'Coolite.Ext.Web.Component'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidCastException: Unable to cast object of type 'Coolite.Ext.Web.Menu' to type 'Coolite.Ext.Web.Component'.]
Coolite.Ext.Web.WebControl.get_ParentWebControl() +73
Coolite.Ext.Web.WebControl.get_IDMode() +228
Coolite.Ext.Web.WebControl.get_ClientID() +70
Coolite.Ext.Web.ItemCollectionJsonConverter.Format (Control control) +182
Coolite.Ext.Web.ItemCollectionJsonConverter.WriteJ son(JsonWriter writer, Object value) +1078
Coolite.Ext.Web.ClientConfig.ToExtConfig(PropertyI nfo property, Object obj, ClientConfigAttribute attr, Object defaultValue) +3934
Coolite.Ext.Web.ClientConfig.Process(Object obj) +263

[Exception: Error during ClientConfig initialization. Items - Unable to cast object of type 'Coolite.Ext.Web.Menu' to type 'Coolite.Ext.Web.Component'.]
Coolite.Ext.Web.ClientConfig.Process(Object obj) +388
Coolite.Ext.Web.ClientConfig.Serialize(Object obj, Boolean ignoreCustomSerialization) +938
Coolite.Ext.Web.ClientConfig.Serialize(Object obj) +36
Coolite.Ext.Web.WebControl.get_InitialConfig() +94
Coolite.Ext.Web.WebControl.GetClientConstructor(Bo olean instanceOnly, String body) +466
Coolite.Ext.Web.WebControl.GetClientConstructor() +35
Coolite.Ext.Web.InnerObservable.RegisterScript(Boo lean inTop) +484
Coolite.Ext.Web.InnerObservable.ParentComponent_Be foreClientInit(Observable sender) +31
Coolite.Ext.Web.OnBeforeClientInitializedHandler.I nvoke(Observable sender) +0
Coolite.Ext.Web.Observable.OnBeforeClientInitHandl er() +56
Coolite.Ext.Web.Observable.OnClientInit() +27
Coolite.Ext.Web.WebControl.SetResources() +149
Coolite.Ext.Web.WebControl.PreRenderAction() +642
Coolite.Ext.Web.WebControl.OnPreRender(EventArgs e) +28
Coolite.Ext.Web.Container.OnPreRender(EventArgs e) +155
System.Web.UI.Control.PreRenderRecursiveInternal() +86
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Control.PreRenderRecursiveInternal() +170
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041


Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433


Cheers,
Timothy

geoffrey.mcgill
Dec 02, 2008, 1:30 PM
Maybe just post the full exception details and stacktrace if you could. 

We haven't been able to reproduce, so it's difficult to track down the problem. 

Timothy
Dec 02, 2008, 1:32 PM
geoffrey.mcgill (12/2/2008)Maybe just post the full exception details and stacktrace if you could.

We haven't been able to reproduce, so it's difficult to track down the problem.




You got what you want from my last post? Or need more?

Cheers,
Timothy

geoffrey.mcgill
Dec 02, 2008, 1:36 PM
You got what you want from my last post?  Or need more?

Yes, perfect. We posted 45 seconds apart and in the time it took for me to write the response, you had posted the stacktrace. 


We're disecting the stack and trying to reproduce. 

Timothy
Dec 02, 2008, 1:38 PM
Would appear to be with the new additions to the WebControl.cs with addition of the IDMode. I'm going to play around with it.

Cheers,
Timothy

geoffrey.mcgill
Dec 02, 2008, 1:48 PM
Ok, we found and fixed the bug. 

Just running a few tests to confirm everything, but it was a very obvious casting bug.


I'll be committing fix within a few minutes. 

Timothy
Dec 02, 2008, 1:54 PM
Awesome, let me know and I will confirm the fix.

Question, I'm curious as to why a 32-bit vs. 64-bit system would make a difference? Has the Toolkit been development with platform dependent logic? Sorry, I haven't been checking the source lately to completely keep up.

Cheers,
Timothy

geoffrey.mcgill
Dec 02, 2008, 2:00 PM
Question, I'm curious as to why a 32-bit vs. 64-bit system would make a difference?  Has the Toolkit been development with platform dependent logic?  Sorry, I haven't been checking the source lately to completely keep up.

I only asked because Matteo ran into the same problem and he mentioned of a recent upgrade from 32 to 64 bit systems. 


There Toolkit controls are not processor/platform dependent and contain no processor/platform dependent logic.

geoffrey.mcgill
Dec 02, 2008, 2:04 PM
Fix has been committed. 

Please svn update and confirm everything is working properly for you now.

Timothy
Dec 02, 2008, 3:39 PM
Corrected, thank you.