• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Variable ByteArray is not defined in generated introspection file

Guest
Jun 09, 2011 Jun 09, 2011

Copy link to clipboard

Copied

I am getting this error, Variable ByteArray is not defined.   This worked fine against Flex SDK 4.0 and is now throwing a runtime  error once it is built against the 4.5 SDK.  Is this related to updates  to the introspection in Flash Builder?

Keith H.

ReferenceError: Error #1065: Variable ByteArray is not defined.

at global/flash.utils::getDefinitionByName()

at  com.adobe.serializers.utility::TypeUtility$/assignProperty()

at  com.adobe.serializers.utility::TypeUtility$/convertToStrongType()

at  com.adobe.serializers.utility::TypeUtility$/convertListToStrongType() 

at  com.adobe.serializers.utility::TypeUtility$/assignProperty()

at  com.adobe.serializers.utility::TypeUtility$/convertToStrongType()

at  com.adobe.serializers.utility::TypeUtility$/convertListToStrongType() 

at  com.adobe.serializers.utility::TypeUtility$/assignProperty()

at  com.adobe.serializers.utility::TypeUtility$/convertToStrongType()

at  com.adobe.serializers.utility::TypeUtility$/convertResultHandler()

at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::processResult()

at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()

at mx.rpc::Responder/result()

at mx.rpc::AsyncRequest/acknowledge()

at  DirectHTTPMessageResponder/completeHandler()

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/onComplete()

Views

4.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 09, 2011 Jun 09, 2011

Copy link to clipboard

Copied

I figured out what the issue is on our side and it is related to a file that is generated by the data services introspection.  The catch here, is this is an auto-generated file that is NOT meant to be modified by the developer becuase it is overwritten each time re-introspection occurs.  Hopefully I can explain this correctly....


We have a file named _DocumentEntityMetadata.as that is generated upon introspection of a web service.  This file uses the ByteArray as a type for the document binary data.  On line 12 of the file, there is an import of the flash.utils.ByteArray class.  And then this line exists under the property type matching section of the file


model_internal::propertyTypeMap["document"] = "ByteArray";


This line is the ONLY reference to the ByteArray class in the file.  If you comment this line out the error goes away.  Here is my thinking on this...


In many examples on how to resolve this issue we found that the solution was to actually create an instance of the ByteArray class in your code.  Even if it was a dummy instance, according the the posts we read.  This instructed the compiler to include the ByteArray class during compilation.  According to the documentation, the import statement does NOT import the class.  The use of the object in your code is what actaully adds the ByteArray type to your final compiled swf.  This sort of makes sense, since we often leave imports in that we don't need at runtime.


So I think the line above is technically not an instance of the ByteArray class and more like a reference to the type.  Hence why it was not included during the compiling process.


Short story....this is a bug in the introspection process in Flash Builder 4.5.  FYI the FB 4.0 introspected version of the _DocumentEntityMetadata.as is completely different and does not have an error when executed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 17, 2011 Jun 17, 2011

Copy link to clipboard

Copied

I am facing similar error. Please let me know the links where you find solution for this problem.

I have many files generated upon introspection of a web service which contains similar line as follows:

model_internal::propertyTypeMap["uid"] = "ByteArray";

ReferenceError: Error #1065: Variable ByteArray is not defined.
    at global/flash.utils::getDefinitionByName()
    at com.adobe.serializers.utility::TypeUtility$/assignProperty()
    at com.adobe.serializers.utility::TypeUtility$/convertToStrongType()
    at com.adobe.serializers.utility::TypeUtility$/convertResultHandler()
    at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::processResult()
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
    at mx.rpc::Responder/result()
    at mx.rpc::AsyncRequest/acknowledge()
    at DirectHTTPMessageResponder/completeHandler()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

Thanks,
Deepa

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 17, 2011 Jun 17, 2011

Copy link to clipboard

Copied

So far I have no reliable solution since these files are overwritten during introspection.

FYI - I submitted to the Flex Bug Tracker.  Here is the link to the submission.

http://bugs.adobe.com/jira/browse/FB-31212

Keith H.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 29, 2013 Oct 29, 2013

Copy link to clipboard

Copied

LATEST

The quickest way to fix this is to change line

model_internal::propertyTypeMap["uid"] = "ByteArray";

to

model_internal::propertyTypeMap["uid"] = "flash.utils.ByteArray";

The worst thing is that line is in metadata model constructor, but(!) it assings to the static(!) variable propertyTypeMap.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 03, 2011 Oct 03, 2011

Copy link to clipboard

Copied

Have you found any work around for this?

This is a show stopper for me also.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 03, 2011 Oct 03, 2011

Copy link to clipboard

Copied

Jeff,

The only thing we have been able to come up with is too comment the line out in the EntityMetadata.as file.  The good news for us is, commenting out this line does not affect the system at runtime.  It seems to be something not all that necessary.  But, of course, commenting it out is required after each introspection.

NOT AT ALL a solution, but it works for us.  Adobe has dropped the ball on this and not really provided any information on it.

It's getting harder and harder to justify the use of Flex with issues like this poppin up.

K

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 03, 2011 Oct 03, 2011

Copy link to clipboard

Copied

I tried commenting out the lines with "ByteArray" in them and get a different error. I'm not sure we are trying to do the same thing. I have an image field in MS SQL where I store a .jpg image. I select the image in a Coldfusion cfc query then use the <mx:Image tag to display the image.

I may see if I can just pull the image field straight to the <mx:Image tag without converting it to a ByteArray.

At this point it looks like I wasted the companies money buying the upgrade to Flash Builder and Coldfusion Builder I won't be able to use Flash Builder 4.5 with this bug.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2011 Oct 04, 2011

Copy link to clipboard

Copied

I have installed Flash Builder 4.5 and Coldfusion Builder 2 on a different computer to the C drive vs the D drive on the where I am getting the error. In a quick test I do not get the error so far. 

Did you install to the C drive?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 04, 2011 Oct 04, 2011

Copy link to clipboard

Copied

Yup on the C drive for sure.  But.....did you go and get the latest 4.5 release or did you use your old one?  Maybe they released a fix?

K

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 04, 2011 Oct 04, 2011

Copy link to clipboard

Copied

I didn't get a new download but I may have downloaded this after the install on the other computer. I'm trying to see what is different. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 14, 2011 Nov 14, 2011

Copy link to clipboard

Copied

This is definitly is a bug. In have installed on 3 different computers now and get the same error when selecting a binary photo from MS SQL. The has worked fine with Flash Builder 4.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines