ExpandItem() error for Flex filtered Tree component
While working on one of our projects I have noticed this error, which apparently comes from inside the Flex Tree class:
TypeError: Error #1010: A term is undefined and has no properties.
at mx.controls::Tree/expandItem()
[...src\mx\controls\Tree.as:1778]
...
This error could happen when calling exapndItem() method immediately after setting the Tree’s dataProvider property. This is because the Tree does not manage to update itself between the calls.
This issue has been addressed in the following post, but from a quick look I have only spotted a sort of a hack.
Here is a more elegant solution to the expanItem() problem. This was inspired from the following Adobe link. One could extend the Tree component and implement a refresh() method like the one described below:
1 2 3 4 5 6 7 8 | public function refresh():void { // Refresh all rows on next update. invalidateList(); openItems = openItems; // Validate and update the properties and layout // of this object and redraw it, if necessary. validateNow(); } |
Then just make sure to call a refresh() before a call to expandItem(). In this case the expanItem() call will be safe.
Schema Error: “The type attribute cannot be present with either simpleType or complexType”
I came across this error message today on my attempt of validating a rather simple XML against a schema I wrote. However simple this XML was, I still had to specify restrictions upon the values some attributes could take. Here did all the problems begin, since I found the documentation available on-line to be rather ambiguous about the syntax of the tags I had to use.
The critical section of my schema – where I specified the restrictions – was:
1 2 3 4 5 6 7 8 9 10 11 12 | <xs:attribute name="dataType" type="xs:string"> <xs:simpeType> <xs:restriction base="xs:string"> <xs:enumeration value="category"/> <xs:enumeration value="date"/> <xs:enumeration value="float"/> <xs:enumeration value="integer"/> <xs:enumeration value="long"/> <xs:enumeration value="string"/> </xs:restriction> </xs:simpleType> </xs:attribute> |
The error message I got from the validator wasn’t very informative, so it took some time until I localized the problem. The error appeared due to the fact that the attribute “dataType” already had a “type” defined at the top level, which resulted in conflicting behavior with the “base” attribute of the restriction defined afterwards. Though this was not explicitly stated in the documentation I was able to find on-line, it seems that these two attributes exclude each other, since they basically specify the same thing.
Deleting the “type” attribute finally solved my problem:
1 2 3 4 5 6 7 8 9 10 11 12 | <xs:attribute name="dataType"> <xs:simpeType> <xs:restriction base="xs:string"> <xs:enumeration value="category"/> <xs:enumeration value="date"/> <xs:enumeration value="float"/> <xs:enumeration value="integer"/> <xs:enumeration value="long"/> <xs:enumeration value="string"/> </xs:restriction> </xs:simpleType> </xs:attribute> |
Configuring AHFormatter (V4.3 and V5.1) from Antenna House for Ubuntu 9.10
The latest version of Antenna House Formatter can be found at:
http://www.antennahouse.com/product/ahf50/download.htm
If you’re working under Linux/Ubuntu, you can use Alien to convert the .rpm package to Debian/Ubuntu .deb format.
Use this command to install Alien:
1 | apt-get install alien |
After converting the .rpm package to .deb using Alien, and installing the AHFormatter V4.3 or V5.1 (by default in /usr), some errors might occure at run time:
1 | ./run.sh: 32: @@HOME@@/bin/XSLCmd: not found |
What you have to do is to edit the “run.sh” from the installation folder of AHFormatter (let’s say /usr/AHFormatterV51/run.sh) and replace the line:
1 | AHF51_HOME="@@HOME@@" |
with the folder where you installed the Formatter. Let’s say:
1 | AHF51_HOME="/usr/AHFormatterV51" |
The second replacement is in the “font-config.xml” file from the “etc” folder of AHFormatter (let’s say /usr/AHFormatterV51/etc/font-config.xml) at line:
1 | font-folder path="@@HOME@@/fonts" |
with the folder where you installed the Formatter:
1 | font-folder path="/usr/AHFormatterV51/fonts" |
Now you can enjoy the AHFormatter!:)
Problems with Rainbow Pdf Server Based Convertor installation and configuration on Ubuntu 9.10 64 bit
In order to install the converter, the downloaded rpm package should be installed. The instruction to install it without converting it to a .deb package is:
1 | sudo rpm -i RainbowPDFServerBasedConverter-xxx.rpm --force-debian --nodeps |
The installation directory can be provided with the –prefix “installation location” parameters, otherwise it will be installed to the /usr/ServerBasedConvertor location.
To make a a sample conversion the run.sh script must be executed, a frequent error that could appear is:
1 2 | /usr/ServerBasedConverter/bin/SBCCmd: symbol lookup error: /usr/ServerBasedConverter/lib/libOSMesa.so.6: undefined symbol: _tnl_run_pipeline |
This means that the converter wants to use the shared objects that came with the installation (in the ~/ServerBasedConvertor/lib directory). As these objects were probably compiled on a different system, the ones that cause the problem must be deleted from the installation directory and the native libraries of the system should be installed.
In our example the ~/ServerBsedConvertor/lib/libOsMesa.so and ~/ServerBsedConvertor/lib/libOsMesa.so.6 files are going to be deleted and the libosMesa6 library will be installed with the following command:
1 | sudo apt-get install libOsMesa6 |
After these errors disappear the shell script should run properly.
If trying to compile and run the sample Java code the publishers provided, the following things must be done:
Some environment variables must be set. These can be found on the publishers site at the following address:
http://rainbowpdf.com/serverdoc/xfo-env.html
After setting the necessary variables a possible error that might appear is:
1 2 3 4 5 6 | Exception in thread "main" java.lang.UnsatisfiedLinkError: no DfvJavaCtl21 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at jp.co.antenna.DfvJavaCtl.DfvObj.<clinit>(DfvObj.java:269) at sample.main(sample.java:28) |
The cause of this error is that a shared object file does not have the name what the program is searching for. It seems that in the 3.0 package for 64 bit Linux (maybe in other packages as well) a shared object file has not been renamed from the last version.
A quick solution would be to rename one of the symbolic links (rename libDfvJavaCtl.so to libDfvJavaCtl21.so) which point to a library file with the following command:
1 | mv /usr/ServerBasedConverter/lib/libDfvJavaCtl.so /usr/ServerBasedConverter/lib/DfvJavaCtl21.so |
Now everything should work.
Overcoming “invocation forwarded to primary instance” in Adobe AIR
… I’m only referring to AIR applications launched from command line adl here, not of installed AIR applications.
So, I had a java program that needed to run several instances of the same AIR application. By default, calling the following line more than once while the initial application is active:
1 | adl.exe /path/to/air-application-descriptor.xml |
…, will result in all calls being forwarded to the first instance (message: “invocation forwarded to primary instance”). Since the whole idea of running several apps in the same time is for each to do something specific, this is kind of a blocker.
Good thing that AIR uses only the application id (found under <id> tag in the descriptor) to identify between applications launches. Therefor the solution was pretty straight-forward:
- replicate the original application descriptor and give it a standardized unique name
- update the ids for each descriptor and make sure they are unique
- do a programmatic search in the folder for application descriptors matching the standard name and create a thread pool with launchers for them (this was on java side)
You might find this useful (ant code for replicating descriptors/renaming ids):
1 2 3 4 5 6 7 8 9 | <for begin="1" end="${APP_COUNT}" param="i"> <sequential> <copy file="src/demo-app.xml" tofile="dist/demo-app-@{i}.xml" overwrite="true" /> <replace file="dist/demo-app-@{i}.xml"> <replacetoken><![CDATA[<id>demo-app</id>]]></replacetoken> <replacevalue><![CDATA[<id>demo-app-@{i}</id>]]></replacevalue> </replace> </sequential> </for> |
…, where application_id is the ID of the application (usually set to project name) and APP_COUNT is a property setting the number of apps to be deployed.
