|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Has anybody run into this error with WebORB.net and Flex3 yet? I've been researching this and the closest I've found is finding somebody else's WebORB log online with a similar error. My setup is Flex3, WebORB.net, IIS7, on Win7 Flex3 is using the WebOrb generated code, Flex3 Remoting style. My Flex app works like this. - Two standalone Flex applications calling different WebORB classes from the same namespace ( EG : MyProject.class1 and MyProject.class2 ). - One parent.mxml flex application that contains a master ViewStack containing VBox, which contain a SWFLoader. When parent.mxml loads up, the first flex application loads up in the ViewStack.selectedIndex = 0. No problem. When I switch to page two via a TogglebuttonBar ( selectedIndex = 1 ), the second flex application fails with the "Length cannot be less than zero. Parameter name: length..." error from WebORB. I've researched Adobe's bugbase and couldn't find anything recent. I checked the forums and everywhere without luck. The only workaround I have found so far is to replace the SWFLoader for any additional page with the code from the second mxml application. In other works, I can only load one external swf that uses WebORB. The rest of the 'pages' need the code living inside the parent.mxml file. Any suggestions would greatly appreciated I checked my WebORB log and found this Quote: [Thread-6] WEBORB INFO:1/27/2010 7:00:31 PM:Request is in session pvleyfbelp0vzkzuez3fvv45 [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:MessageReader:: parsing stream [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:MessageReader:: parsing message - version: 3 totalHeaders: 0 [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:MessageReader:: Total body parts: 1 [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:MessageReader::readBodyPart: serviceURI - null responseURI - /2 length: 231 [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property operation [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property source [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property clientId [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property timestamp [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property headers [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property timeToLive [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property destination [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property messageId [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:reading object property body [Thread-6] WEBORB DEBUG:1/27/2010 7:00:31 PM:MessageReader:: returning AMFMessage [Thread-6] WEBORB INFO:1/27/2010 7:00:31 PM:Dispatching request processing to V3 Dispatcher [Thread-6] WEBORB INFO:1/27/2010 7:00:31 PM:Dispatching request processing to Service Inspector [Thread-6] WEBORB INFO:1/27/2010 7:00:31 PM:Dispatching request processing to Service Invoker [Thread-6] WEBORB ERROR:1/27/2010 7:00:31 PM:System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at Weborb.Dispatch.Invoker.dispatch(Request message, RequestContext context) at Weborb.Dispatch.Dispatchers.dispatch(Request message, RequestContext context) at Weborb.ORBHttpHandler.a(HttpContext A_0, HttpRequest A_1, HttpResponse A_2)
|
|
 Rank: Administration Groups: Administration
Joined: 8/21/2006 Posts: 679 Points: 1,280 Location: Frisco, TX
|
That's a very odd error! Could you try firing up AppPuncher next to your browser and see what the client sends on the wire? If you use localhost in your URL, make sure to add dot '.' after localhost so AppPuncher can pick up traffic (http://localhost./your-path-to-flex-app-here). Cheers, Mark
Mark Piller Midnight Coders, Inc. twitter: midnightcoderblog: blog.themidnightcoders.comwebsite: www.themidnightcoders.com
|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Hey Mark, Here's what I found. Load http://localhost/SysMan/APPS/DASHBOARD/DashboardShell.html two tabs both loading an external SWF ( made by Flex ) that both contain WebORB calls Tab 1 loads fine WebORB log stops at : [Thread-5] WEBORB DEBUG:1/29/2010 11:47:24 AM:done processing request. Tab 2 AppPuncher shows - command:ping ( same looking request as Tab1, only GUIDs differ ) - null Clicking on null shows an AMF Message in the request AMF Response is just the error Flex throws this error Quote: TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::PopUpManagerImpl@eed50a1 to mx.managers.IPopUpManager. at mx.managers::PopUpManager$/get impl()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManager.as:68] at mx.managers::PopUpManager$/addPopUp()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManager.as:169] at mx.controls::Alert$/show()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\Alert.as:519] at SmartDevices::DashboardMy/onFault()[D:\_WIRETREE\PROJECTS\SmartEarth\SmartEarthApps\FlexDashboard\src\SmartDevices\DashboardMy.as:100] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractService/dispatchEvent()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AbstractService.as:283] at mx.rpc::AbstractOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AbstractOperation.as:209] at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:295] at mx.rpc::Responder/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:58] at mx.rpc::AsyncRequest/fault()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103] at NetConnectionMessageResponder/statusHandler()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\channels\NetConnectionChannel.as:586] at mx.messaging::MessageResponder/status()[C:\autobuild\3.5.0\frameworks\projects\rpc\src\mx\messaging\MessageResponder.as:222]
WebORB log shows ( I wasn't sure what to include so here's everything for this second tab request. I collapsed the repeated blocks to cut down on data ) Quote: [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:Received request for http://localhost/SEDS/weborb.aspx from 127.0.0.1 [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:Request is in session tmjwt3yl20eecemtl3eux555 [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: parsing stream [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: parsing message - version: 3 totalHeaders: 0 [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: Total body parts: 1 [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader::readBodyPart: serviceURI - null responseURI - /1 length: 224
[Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:reading object property ... bunch of these
[Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: returning AMFMessage [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:Dispatching request processing to V3 Dispatcher [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:checking argument factory for Weborb.V3Types.ReqMessage [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:looking up service factory for Weborb.V3Types.ReqMessage [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:factory is null
[Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:initializing property ... bunch of these [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:property type - ... bunch of these [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:checking argument factory for ... bunch of these [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:argument factory is missing or returned no value. will use type adaptation [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:initializing property ... bunch of these
[Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:property type - System.String [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:checking argument factory for System.String [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:argument factory is missing or returned no value. will use type adaptation [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:V3 Dispatcher successfully handled request processing [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:Starting response serialization [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:got headers 0 [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:got bodies 1 [Thread-6] WEBORB INFO:1/29/2010 11:48:22 AM:AMFMessageWriter.write - message version: 3 header length: 0 [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:AMFBodyWriter:write body.responseURI: /1/onResult body.serviceURI: [Thread-6] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:cannot find a writer for the object, will use default writer - Weborb.Writer.ObjectWriter [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing using cached Class Def flex.messaging.messages.AcknowledgeMessage
[Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing property/field : ... bunch of these
[Thread-6] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:looking up writer for System.Collections.IDictionary [Thread-6] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:returning Weborb.Writer.BoundPropertyBagWriter for interface System.Collections.IDictionary [Thread-6] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:found a writer for an interface - Weborb.Writer.BoundPropertyBagWriter [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing property/field : correlationId [Thread-6] WEBORB DEBUG:1/29/2010 11:48:22 AM:done processing request. [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Received request for http://localhost/SEDS/weborb.aspx from 127.0.0.1 [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Request is in session tmjwt3yl20eecemtl3eux555 [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: parsing stream [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: parsing message - version: 3 totalHeaders: 0 [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: Total body parts: 1 [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader::readBodyPart: serviceURI - null responseURI - /2 length: 237
[Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:reading object property ... bunch of these
[Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:MessageReader:: returning AMFMessage [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Dispatching request processing to V3 Dispatcher [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Dispatching request processing to Service Inspector [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Dispatching request processing to Service Invoker [Thread-5] WEBORB ERROR:1/29/2010 11:48:22 AM:System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at Weborb.Dispatch.Invoker.dispatch(Request message, RequestContext context) at Weborb.Dispatch.Dispatchers.dispatch(Request message, RequestContext context) at Weborb.ORBHttpHandler.a(HttpContext A_0, HttpRequest A_1, HttpResponse A_2) [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:Starting response serialization [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:got headers 0 [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:got bodies 1 [Thread-5] WEBORB INFO:1/29/2010 11:48:22 AM:AMFMessageWriter.write - message version: 3 header length: 0 [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:AMFBodyWriter:write body.responseURI: /2/onStatus body.serviceURI: [Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:cannot find a writer for the object, will use default writer - Weborb.Writer.ObjectWriter
[Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing property/field : .... bunch of these
[Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:looking up writer for System.Collections.IDictionary [Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:returning Weborb.Writer.BoundPropertyBagWriter for interface System.Collections.IDictionary [Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:found a writer for an interface - Weborb.Writer.BoundPropertyBagWriter
[Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing property/field : ... bunch of these
[Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:looking up writer for System.Collections.IDictionary [Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:returning Weborb.Writer.BoundPropertyBagWriter for interface System.Collections.IDictionary [Thread-5] WEBORB SERIALIZATION:1/29/2010 11:48:22 AM:found a writer for an interface - Weborb.Writer.BoundPropertyBagWriter [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:serializing property/field : correlationId [Thread-5] WEBORB DEBUG:1/29/2010 11:48:22 AM:done processing request.
I'm unsure what all to share from AppPuncher so here are two screen shots. Here is AppPuncher when I run my main Shell application ( the shell has the ViewStack, each stack containing a SWFLoader simulating a "page" paradigm )  Here is AppPuncher when I run my tab2 application by itself  I'm going to whip up another Flex test that calls the default weborb30 services. I can easily see this being a config issue on my side, or something I just don't know about yet. If there's any other information I can share just let me know.
|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Mark ( and anybody else interested ). I was able to duplicate this exact same problem with the default weborb.net installation and two of the sample classes. Same paradigm, shell page with ViewStack trying to load external flex SWFs ( not Flex Modules ) that use WebORB. Result, the first loaded external SWF always works. Every external weborb swf after the first fails. Sample Flex application loading external weborb SWFs into ViewStackHelp yourself to this Flex application. It uses the sample Phonebook and WeatherService and behaves exactly like the application I'm currently working on. Again, if there's any other information I can get to you just let me know. Thanks in advance for all your help and attention to this.
|
|
 Rank: Administration Groups: Administration
Joined: 8/21/2006 Posts: 679 Points: 1,280 Location: Frisco, TX
|
Thanks, Eric. I'll be looking into it. Cheers, Mark
Mark Piller Midnight Coders, Inc. twitter: midnightcoderblog: blog.themidnightcoders.comwebsite: www.themidnightcoders.com
|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Mark, I found a workaround to this issue. In the sample Flex app above, open shell.mxml and locate function tabButtonClick. If I instantiates the WebORB objects that my child mxml uses, this bug doesn't happen. Code: public function tabButtonClick( btnIdx:Number ):void { // get page information from btnIdx var pg:Object = _screens[ btnIdx ]; if( pg ) { // change page in ViewStack view_stack.selectedIndex = pg.stackIndex; // BUTTON SPECIFIC HANDLING // switch( btnIdx ) { case 0: pgOneSwfLoader.source = pg.url; break; case 1: // HACK - to get two.mxml to load externally, init the WebORB classes here var _phonebookModel:PhoneBookModel = new PhoneBookModel(); var _phonebookService:PhoneBook = new PhoneBook( _phonebookModel );
// load SWF pgTwoSwfLoader.source = pg.url; break; } // BUTTON SPECIFIC HANDLING //
} }
Unsure if this is a Flex thing, but this gets me around the issue temporarily.
|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Mark,
I found an alternate solution here.
1.Convert the child mxml apps to Flex Modules
2.Replace the SWFLoader with ModuleLoader in shell.mxml
3.In tabButtonClick, hook the modules up like so
// setup security p1ModuleLoader.applicationDomain = ApplicationDomain.current; p1ModuleLoader.loadModule( pg.url );
This is starting to make sense, but I haven't been able to figure out how to load it via SWFLoader and external SWF. I played around with a custom LoaderContext for SWFLoader but never got it working. I'm going to go the Flex Module route for now.
|
|
 Rank: Administration Groups: Administration
Joined: 8/21/2006 Posts: 679 Points: 1,280 Location: Frisco, TX
|
Hi Eric, Thanks for the update. Something to watch out with Flex Modules is there is a known memory leak bug in Flex SDK. Dunno if they fixed it in 3.5, but it is definitely in 3.4. Cheers, Mark
Mark Piller Midnight Coders, Inc. twitter: midnightcoderblog: blog.themidnightcoders.comwebsite: www.themidnightcoders.com
|
|
Rank: Apprentice Coder Groups: Member
Joined: 8/7/2009 Posts: 13 Points: 39 Location: Denver, CO
|
Mark,
Thanks for the tip. Today I rewrote my shell app as a component and updated my SDK to 3.5a. So far so good, just never figured out the original external swf problem. I'm thinking if there's a fix, it has to do with AppDomain and LoaderContext.
If you happen to find anything I'd love to hear it.
|
|
|
Guest |