Error: No class registered for interface 'mx.resources::IResourceManager'.

299 views
Skip to first unread message

Anil

unread,
Mar 11, 2008, 5:39:11 AM3/11/08
to Flex India Community
Hi,

I created a class 'Company' with 2 properties(ie... name, models).
and then 'CompanyFactory' class. Here is the 'CompanyFactory' class.

package com.ascript
{
import mx.collections.ArrayCollection;
public class CompanyFactory {
static public var companies:ArrayCollection;
static public function getCompanies():ArrayCollection {
if(companies == null) {
trace("Before defining");
companies = new ArrayCollection();
trace("After defining");
companies.addItem( new Company("Comp1", ["c1", "c2"]));
companies.addItem( new Company("Comp2", ["s1", "s2" , "s3"]));
companies.addItem( new Company("Comp3", ["n1"]));
}
return companies;
}
}
}

In another class called CompanyData. I started accessing companies
data using
var companies:ArrayCollection = CompanyFactory.getCompanies();

And finally I created one component mxml file(CompTree.mxml):

<?xml version="1.0" encoding="utf-8"?>
<local:CompaniesData xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:local="com.ascript.*">
<mx:...>
.....
....
</mx:...>
</local:CompaniesData>

I compiled this using mxmlc CompTree.mxml. and when I loaded
CompTree.swf in to the browser It started throwing the following
Error.

Error: No class registered for interface
'mx.resources::IResourceManager'.
at mx.core::Singleton$/getInstance()
at mx.resources::ResourceManager$/getInstance()
at mx.collections::ListCollectionView()
at mx.collections::ArrayCollection()
at com.ascript::CompanyFactory$/getCompanies()
at com.ascript::CompaniesData()
at com.views::CompTree()

Its not giving any trace statments after running the "companies = new
ArrayCollection();" in CompanyFactory's getCompanies method.

Can any one help me to get rid of this.
What is this problem exactly mean?
Looking for your reply.

Thanks,
Anil

Vinod M Jacob

unread,
Mar 11, 2008, 6:13:21 AM3/11/08
to Flex India Community
HI-

Create a new instance for your class then try
instanceName.getCompanies();

Saravanan

unread,
Mar 11, 2008, 7:24:00 AM3/11/08
to Flex India Community
hi thats static function

Saravanan

unread,
Mar 11, 2008, 7:27:34 AM3/11/08
to Flex India Community
HI

On Mar 11, 3:13 pm, Vinod M Jacob <flex4...@gmail.com> wrote:
> HI Anil pls check all classes were in same package ....

Anil

unread,
Mar 11, 2008, 8:16:46 AM3/11/08
to Flex India Community
Hi,

All classes are there in same package.
Here is the package structure..
com ----> ascript ---> all AS3 files
com ----> views ---> CompTree.mxml

Any suggestions pls..

Thanks,
Anil

Rob Jellinghaus

unread,
Mar 18, 2008, 12:36:20 PM3/18/08
to Flex India Community
This is a bug in Flex 3.0.0:

http://bugs.adobe.com/jira/browse/SDK-12205

Adobe evidently considers it serious enough for a hotfix. It bit us
also because we use mx.logger classes in our Actionscript 3
application, which is now broken with the same exception.

Essentially, in 3.0.0, Adobe put dependencies on their
internationalization framework into pretty much all of their low-level
SDK classes (such as Log or ArrayCollection). And the 3.0.0
initialization of the internationalization is bugged and does not work
within a non-Flex AS3 application.

Please keep an eye on that bug and encourage Adobe to fix it.
Cheers!
Rob

Rob Jellinghaus

unread,
Mar 18, 2008, 1:12:21 PM3/18/08
to Flex India Community
Replying to myself:

I just found the following workaround that has gotten me past this bug
in my AS3-only application.

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");
mx.core.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 :-)
Cheers!
Rob

ABCD

unread,
May 6, 2008, 4:30:29 PM5/6/08
to Flex India Community
Thank you, that helped me get SOAP working in my as3 project (which
uses the flex library). I also had to add all the locale property
files.

ABCD

unread,
May 6, 2008, 4:30:37 PM5/6/08
to Flex India Community
Thank you, that helped me get SOAP working in my as3 project (which
uses the flex library). I also had to add all the locale property
files.

On Mar 18, 10:12 am, Rob Jellinghaus <rjellingh...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages