History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-12205
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: B B
Assignee: Robert Vollmar
Reporter: Deepa Subramaniam
Votes: 4
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Cannot use RPC classes outside of an Application instance in Moxie [backwards compatibility]

Created: 08/16/07 04:24 PM   Updated: 03/27/08 12:47 PM
Component/s: Runtime Localization
Security Level: Public (All JIRA Users )

File Attachments: 1. Zip Archive Archive.zip (3 kb)

Issue Links:
Duplicate
 
This issue is duplicated by:
SDK-14890 Cannot use mx.logging in a Flex 3 Act... None Closed
SDK-12214 ResourceManager init dependency in Fl... None Closed

Severity: Incorrectly Functioning
Reproducibility: Every Time
Discoverability: High
Found in Version: SDK Moxie M2 (Beta)
Milestone: SDK Moxie M3 (Beta 2) and SDK Flex 3.0.1
Affected OS(s): All OS Platforms - All
Steps to Reproduce:
We had written the RPC classes to be usable outside of an Application instance (ie: a la carte in an AS project), but now with the new runtime localization feature this has been broken since the RPC classes emit localized error messages that depend on a ResourceManager instance having been created (which only happens via Application).

We have broken backwards compatability here.
 
 
 
Language Found: English
Bugbase Id: none
Triaged: No
Regression: Yes
QA Owner: Robert Vollmar
Resolved by: Lauren Park
Participants: Deepa Subramaniam, Gordon Smith, Joan Lafferty, Lauren Park, Rob Jellinghaus and Robert Vollmar

Sub-Tasks  All   Open   
 Sub-Task Progress: 

 All   Comments      Sort Order:
Deepa Subramaniam - [08/16/07 04:25 PM ]
Have spoken to Gordon about this - came up at 360. Should be fixed for Moxie.

Robert Vollmar - [08/17/07 02:59 PM ]
Could you please include sample code of an app. which should compile? Thanks. Making Info. Needed.

Robert Vollmar - [08/17/07 03:41 PM - edited ]
Sending to IRB per Deepa. Gordon, could you please include files I can test with when this is fixed?

Lauren Park - [08/17/07 05:03 PM ]
Opened to Gordon.

Gordon Smith - [08/20/07 04:17 PM - edited ]
The ResourceManager wasn't designed to work outside the Flex framework. It currently relies on startup code in SystemManager to instantiate the compiled bundle classes. If we want it to work without SystemManager, I need to redesign this.

After thinking about this, I believe I can fix the problem with 1 day's work.

Robert Vollmar - [08/21/07 11:56 AM ]
The bug file in SDK-12214 demonstrates this.

Gordon Smith - [09/02/07 05:31 PM ]
Fixed with several changes culminating in 181344. A non-framework app which simply extends Sprite can now use the ResourceManager, and it only needs to compile again flex.swc to do so. For example,

package
{

import flash.display.Sprite;
import mx.resources.IResourceManager;
import mx.resources.ResourceManager;

[ResourceBundle("mybundle")]

public class Test extends Sprite
{
    public function Test()
    {
        var rm:IResourceManager = ResourceManager.getInstance();
        trace(rm.getString("mybundle", "whatever"));
    }
}

this case, the ResourceManager uses the autogenerated _CompiledResourceBundleInfo class (rather than the info() in the SystemManager, since there is no systemManager) to know which resource bundles to install into the ResourceManager.

Robert Vollmar - [09/04/07 07:35 PM ]
Did a basic verification that it works in mainline build 181415.

Robert Vollmar - [03/11/08 07:50 PM - edited ]
Injection. I've confirmed that the code in this bug works fine in build 181493 (from September), but does not work in the released build of Flex 3.0.0. It causes the error:

Error: No class registered for interface 'mx.resources::IResourceManager'.
at mx.core::Singleton$/getInstance()
at mx.resources::ResourceManager$/getInstance()
at Test()

Also, I've confirmed that the BrokenLogging.as file attached to SDK-14890 also worked in 181493 and does not work in the released build of Flex 3.0.0. Be sure to test that bug file as well.

i've uploaded files from related bugs. See Archive.zip.

[hotfix candidate]

Joan Lafferty - [03/14/08 04:42 PM ]
Internal Review -> Opening to Gordon for 3.0.x

Rob Jellinghaus - [03/18/08 12:09 PM ]
A workaround that has gotten me past this bug in my AS3-only application is this:

1) Ensure that your code does no initialization of Log objects before the main application's constructor runs.

2) Put the following at the top of your main application's constructor:

// Do what FlexModuleFactory does, only by hand.
var resourceManagerImpl:Object =
flash.system.ApplicationDomain.currentDomain.getDefinition("mx.resources::ResourceManagerImpl");
Singleton.registerClass("mx.resources::IResourceManager", Class(resourceManagerImpl));

3) Ensure that all initialization of ResourceManager-dependent classes (e.g. ArrayCollection, Logger) happens after the above code has run.

I am not sure if this is the best solution, only that it works for me :-)

Lauren Park - [03/26/08 02:49 PM ]
Marking fixed on Gordon's behalf

Lauren Park - [03/26/08 03:25 PM ]
re-assigning to Rob.

Robert Vollmar - [03/27/08 12:47 PM ]
Confirmed fixed in 3.0.x build 3.0.0.963.