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.
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 com.adobe.serializers.utility::TypeUtility$/assignProperty()[C:\depot\flex\ide_trunk\ide_ builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\TypeUtil ity.as:593]
at com.adobe.serializers.utility::TypeUtility$/convertToStrongType()[C:\depot\flex\ide_trunk \ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\Typ eUtility.as:562]
at com.adobe.serializers.utility::TypeUtility$/convertResultHandler()[C:\depot\flex\ide_trun k\ide_builder\com.adobe.flexbuilder.dcrad\serializers\src\com\adobe\serializers\utility\Ty peUtility.as:436]
at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::processResult()[E:\dev\hero_private\frameworks \projects\rpc\src\mx\rpc\soap\Operation.as:953]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()[E:\dev\hero_private\frameworks \projects\rpc\src\mx\rpc\AbstractInvoker.as:313]
at mx.rpc::Responder/result()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc\Respond er.as:56]
at mx.rpc::AsyncRequest/acknowledge()[E:\dev\hero_private\frameworks\projects\rpc\src\mx\rpc \AsyncRequest.as:84]
at DirectHTTPMessageResponder/completeHandler()[E:\dev\hero_private\frameworks\projects\rpc\ src\mx\messaging\channels\DirectHTTPChannel.as:451]
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.
Have you found any work around for this?
This is a show stopper for me also.
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.
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.
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?
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?
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.
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.
The quickest way to fix this is to change line
model_internal::propertyTypeMap["uid"] = "ByteArray";
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.