Hi all,
so I have been trying to port my flex application to Royale and am currently
working on learning Crux.
Here I was having a problem, that was extremely difficult to trace down.
The effect was, that my Application was giving me the following error in the
browser:
getDefinitionByName.js:59 Uncaught ReferenceError: Error #1065: Variable is
not defined.
at Object.org.apache.royale.reflection.getDefinitionByName
(getDefinitionByName.js:59)
at
Function.org.apache.royale.crux.factories.MetadataHostFactory.getMetadataHost
(MetadataHostFactory.as:71)
at org.apache.royale.crux.reflection.TypeDescriptor.getMetadataHost
(TypeDescriptor.as:149)
at org.apache.royale.crux.reflection.TypeDescriptor.getMetadataHosts
(TypeDescriptor.as:115)
at org.apache.royale.crux.reflection.TypeDescriptor.fromTypeDefinition
(TypeDescriptor.as:170)
at Function.org.apache.royale.crux.reflection.TypeCache.getTypeDescriptor
(TypeCache.as:60)
at Function.org.apache.royale.crux.BeanFactory.constructBean
(BeanFactory.as:616)
at
de.cware.cweb.frontend.config.Beans.org.apache.royale.crux.BeanProvider.initializeBeans
(BeanProvider.as:70)
at
de.cware.cweb.frontend.config.Beans.org.apache.royale.crux.BeanProvider.initialize
(BeanProvider.as:62)
at org.apache.royale.crux.Crux.constructProviders (Crux.as:288)
When setting a breakpoint in getDefinitionByName.js:59 I could see that “name”
is simply set to the empty string.
Also did the stacktrace not really give me any hint to what might be causing
the problem. So I did a debugging session with Carlos.
Effectively we commented out stuff till the application “worked” again. Today I
finally found out what was causing the problem.
In my code I had the following statement:
[EventHandler(event="LoginEvent.LOGIN")]
public function userLogin() {
//serviceHelper.executeServiceCall(remoteModuleService.listModulesForCurrentUser(),
handleListModulesForCurrentUser);
}
I really tried everything, till I noticed I didn’t define a return type, so as
soon as I changed that to:
[EventHandler(event="LoginEvent.LOGIN")]
public function userLogin():void {
//serviceHelper.executeServiceCall(remoteModuleService.listModulesForCurrentUser(),
handleListModulesForCurrentUser);
}
My application worked.
So would there be a way to make sure this sort of problem doesn’t occur or to
give some output that makes tracking down the issue simpler?
Chris