Thank you Adobe for removing me from feeds.adobe.com

May 1st, 2009

Update: it turned out that removal of my blog from feeds.adobe.com was caused by a failure of the site’s database. I have published a blog post Adobe and feeds.adobe.com team, please accept my apology explaining what exactly happened.

I have to say I am really disappointed with this move. I really did not expected that. About a week ago my blog was approved for feeds.adobe.com. I just checked, when I try to ping my blog from here I see:

Adobe Feeds is not currently aggregating this site. If you would like your site to be added, use the Adobe Feeds Feed Submission Form to submit it for approval.

Now the question is, is this because of this post? I expected to be a persona non-grata in the ColdFusion community because of what I have been saying in the past. But that?! After Ben Forta answered my question with the statement that is now quoted all over the internet I asked:

Is this an official statement?

The answer was short: Yes. So what happened to the don’t kill the messenger rule?

Windows 7 Release Candidate – first look

May 1st, 2009

Today I got my hands on fresh Windows 7 RC so I decided to give it a shot. I installed it on VirtualBox 2.2, VM with 1GB of RAM and I have to admit, I am impressed.

There is no visible changes in the UI, the only thing that’s changed is the installer, it is really nice, much nicer than any previous installer. But here is the thing, I couldn’t really enjoy it too long. Installation took only 22 minutes. I wanted to see how quick it is on the boot time. Fresh start, with login screen, 47 seconds… The interface is responsive straight away. That is very good result for Windows running on only 1GB of RAM. I would love to see it on a physical machine.

First impression – I like it. It feels like it is ready to rock. If I just wasn’t in love with Ubuntu… :)

Vote for Flex Builder for Linux

April 28th, 2009

Tom Chiverton has logged a support request in Adobe JIRA for Flex Builder for Linux. Quick recap – a week ago Ben Forta being asked what is the status of Flex Builder for Linux answered: the project is currently on hold. There is not enough requisition for the product to continue its development.

Developers want Flex Builder for Linux! Show your support, vote for it: http://bugs.adobe.com/jira/browse/FB-19053!

More information:

Configuring postfix as a relay for GMail

April 27th, 2009

For the domain this blog is running on I have a separate GMail account, I wanted my server to relay all email there. I was searching quite a lot for detailed info on how to set up postfix correctly but could not find any. All information was scattered across different blogs, websites, forums. I just achieved the target and I thought I will share what I just learned.

All command below were executed under the root account. If an account used is not root use sudo and make sure it is a sudoer.

Confirm that the openssl is installed and if not, install it (on my Ubuntu 8.10 I had it installed by default). If CA certificate was not generated before it is time to do it. On Ubuntu it is nothing else than running following command from the terminal:

[source lang='bash']
/usr/share/ssl/misc/CA.sh -newca
[/source]

If an error is returned it may suggest that the CA.sh script is somewhere else. To find it simply execute following:

[source lang='bash']
find / -name 'CA.sh'
[/source]

and run the first command again with correct CA.sh path. While generating CA certificate the script will ask some questions, just follow the instructions, it is really short and painless process.

The next step is to install postfix.

[source lang='bash']
apt-get install postfix
[/source]

Answer the questions using default options, it appears that in most cases they are fine. Just make sure first question is answered with Satellite system option.

To make sure this process is going to work postfix must be configured with SASL and TLS support and on Ubuntu it was by default, indeed. It can be verified with following command:

[source lang='bash']
ldd /usr/lib/postfix/smtp
[/source]

Look for the line starting with the libssl. I bet it will be there. BUT if not, postfix must be reconfigured with SASL and TLS. Here is just one of the articles of many I found showing how to do it: Setup Email Services on Ubuntu Using Postfix (TLS+SASL).

Once postfix is running:

[source lang='bash']
cd /etc/postfix
mkdir certs
cd certs
openssl genrsa -out itchy.key 1024
openssl req -new -key itchy.key -out itchy.csr
openssl ca -out itchy.pem -infiles itchy.csr
nano main.cf
[/source]

To search for the string in nano use CTRL+W. Look for myhostname key. I have a mx.gruchalski.com value but gruchalski.com would work just fine. Next important bit is mydestination key. I have changed it to smtp.gmail.com and I will explain why in a second. Last key to change is the relayhost. Set it to [smtp.gmail.com]:587. At the end of the file add following lines:

[source lang='bash']
# auth
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd

# tls
smtp_use_tls=yes
smtp_sasl_security_options=noanonymous
smtp_sasl_tls_security_options=noanonymous
smtp_tls_note_starttls_offer=yes
tls_random_source=dev:/dev/urandom
smtp_tls_scert_verifydepth=5
smtp_tls_key_file=/etc/postfix/certs/itchy.key
smtp_tls_cert_file=/etc/postfix/certs/itchy.pem
smtpd_tls_ask_ccert=yes
smtpd_tls_req_ccert=no
smtp_tls_enforce_peername=no
[/source]

CTRL+O to save and CTRL+X to exit.

At this point /etc/postfix/sasl_passwd file does not exist yet, so:

[source lang='bash']
nano /etc/postfix/sasl_passwd
[/source]

Add these two files:

[source lang='bash']
gmail-smtp.l.google.com user@gmail.com:password
smtp.gmail.com user@gmail.com:password
[/source]

Make sure that the correct credentials are set. Save, exit the file and execute:

[source lang-'bash']
postmap /etc/postfix/sasl_passwd
/etc/init.d/postfix reload
apt-get install mailutils
[/source]

It is time to test postfix, that is why I installed mailutils.

[source lang='bash']
echo "Testing relay from terminal" | mail -s "Test relay" to@email -f from@email
[/source]

Well, the -f option is not going to work here anyway but it does not brake anything either :) If an email did not arrived please check /var/log/mail.log for details.

And now an explanation why mydestination key was changed. Let’s say my server name is funkyserver.com and from the terminal or Apache web server I am sending an email to d’oh@funkyserver.com. But I have a d’oh user on the server as well. Postfix is going to think oh, hang on mate, my name is funkyserver.com and you are sending an email to the user who BELONGS TO ME! I am so smart, I am not going to send it via GMail, I will just drop it to the /var/mail/d’oh mailbox!. That email will not appear in GMail. By changing mydestination I am telling postfix do not try to be smart dude, just send it to the outside world and let the others make the decision what to do with it.

The last thing to make sure is that the correct real name for the www-data account (used by Apache) is set. When a sent email is received it will have www-data-real-name <gmail@email> in the from field. By Changing it to WordPress for example, recipients will see it as WordPress <gmail@email> and not www-data <gmail@email>.

What about iptables and security? To make sure no one is going to use postfix as an open relay if it is incorrectly configured, just execute:

[source lang='bash']
iptables -I INPUT -p tcp --dport 110 -i eth0 -j DROP
[/source]

and save iptables rules.

Flex TextRange performance issue on Linux

April 26th, 2009

Earlier this month I mentioned I have found an issue with mx.controls.textClasses.TextRange class. This problem was identified on Linux (Ubuntu 8.10 and 9.04 using Flash Player 10,0,22,87) and could not be replicated on Windows Vista and 7 with latest Flash Player. I had no chance to test it on OSX.

screenshot-sqlcodecoloring

To visualize the problem I am using the code from my previous article, Building an SQL tokenizer in Flex, ported to AIR. I am just using a bit more SQL code. Once the application is started, placing the cursor in the TextArea and hitting CTRL+A causes the AIR application to be unresponsive. It stays like that for about 20, 30 seconds, in fact any attempt to change the selection repeats the issue.

The source of the test application can be downloaded from here. I tried logging a bug but it appears I can create an account in Adobe JIRA but I am not allowed to log in.

Building an SQL tokenizer in Flex

April 25th, 2009

This post is an introduction to the next post that I am going to publish within next few days. It describes one of the features of MySQL on AIR, SQL code tokenizer, used for code coloring.

For those who have no idea what a tokenizer is there is a great introduction on Wikipedia. In a few words, the tokenizer is used to classify parts of a input data by splitting it to smaller chunks. Those chunks may be later used in a variety of ways, for example implement code coloring. This is what I am going to show further.
Read more »

Flex Builder 3 for Linux on hold

April 22nd, 2009

Yesterday, 21st of April, Ben Forta came to London to give a talk about ColdFusion 9 new features. It was really good session, Ben demoed all new major ones. Integration with Hibernate, new Adobe AIR ColdFusion services and of course brand new ColdFusion IDE codenamed Bolt (which does look pretty solid by the way) were most exciting.

After the talk I managed to ask Ben if he knows what is going on with Flex Builder 3 for Linux. The answer was not what I was expecting to hear. Unfortunately the project is currently on hold. Quoting Ben there is not enough requisition for the product to continue its development.

Without a doubt this is really bad news for anyone who invested in infrastructure for building AIR and Flex applications on Linux, it may happen that we are going to stay without the tools. I still believe that Adobe is going to rethink its decision. If they could only fix this one issue: debugger keeps disconnecting from the debugging session… I think most of the developers would be happy then.

Railo, BlazeDS and CFC instances

April 20th, 2009

There is a lot of buzz recently around Railo since version 3.1 finally went open source and many well known CF developers joined the project. This gave me the motivation to finally see how Railo really works. I decided to give it a shot on one of already running applications. The choice was made, I selected a Flex application powered by ColdFusion 8.1 utilizing Adobe ColdFusion classes, providing 20 different gateways, using ODBC data sources and operated with very rich and sophisticated Flex UI exchanging data using typed VOs.

First experience was great. No issues at all, application started very quickly, what takes about 20 seconds on ColdFusion is almost immediate on Railo. All CFCs worked fine, even those using internal ColdFusion classes. Overall performance was fantastic, all JDBC ODBC connections running smoothly. I have to admit that Railo guys have done really great job.

It was time to test Flex UI, a major issue popped out straight away. Railo provides integration with Adobe’s open source Blaze Data Services. It appears to work perfectly fine with all standard CFML types, strings, structures, arrays, etc., however not with CFCs. At the current state Railo is not able to serialize and deserialize them. Below is the sample test case.

Service.cfc that Flex talks to:

[source lang='cf']


  
  
    
    
  

  
  
   
   
   
   
  


[/source]

And here is the source of com.gruchalski.railo.test.TestCFC:

[source lang='cf']

  
  
  
  

[/source]

To access the service I am using following Flex application:

[source lang='as3']



  
    

  

  
  


[/source]

with this com.gruchalski.railo.test.TestCFC VO:

[source lang='as3']
package com.gruchalski.railo.test {

  [RemoteClass(alias="com.gruchalski.railo.test.TestCFC")]
  public class TestCFC {
    public var property1:String = "";
    public var property2:Number = 0;
  }
}
[/source]

When loading a CFC instance following issue is reported:

faultCode:Server.Processing faultString:’An error occurred while serializing server response(s).’ faultDetail:’null’

In case of sending a VO:

faultCode:Server.Processing faultString:’flex.messaging.MessageException: railo.runtime.exp.UDFCasterException : invalid call of the function getCfc, first Argument (INST) is of invalid type, can’t cast Object type [Struct] to a value of type [com.gruchalski.railo.test.TestCFC]‘ faultDetail:’null’

First one is obvious, BlazeDS does not know how to serialize CFC provided by Railo. Second issue is probably caused by the fact that Railo does not treat magic structures as CFCs. What I call a magic structure looks like this:

[source lang='cf']

  struct = structNew();
  struct.property1 = "Some property";
  struct.property2 = 20;
  struct.__type__ = "com.gruchalski.railo.test.TestCFC";

[/source]

When structure like that comes from the outside world or is being sent to outside world (for example BlazeDS iteraction or SOAP request) Adobe ColdFusion treats it as a CFC instance.

Despite the issue I think Railo is a very good choice in its current state. For most small applications current BlazeDS integration level is enough, new applications can easily use what is there right now. And I am sure that Railo team is working hard to enable full support.

It is good however to know the limitations before making the switch to Railo, specially when so many people consider to do so.

So what is going on with Flex Builder for Linux?

April 20th, 2009

First, I have to say that I am big fan of Flex technology. I have worked a little bit with Flex 1, then 1.5 and now full time with Flex 2 and 3. I saw how the platform evolved, I saw Macromedia’s and Adobe’s enthusiasm when they have been announcing every new release. I am really greatful to those who delivered this great product.

But I have a question, first however I want to explain what made me to ask it.

If you are a Flex developer you are probably aware that in year 2007 Adobe released Flex Builder alpha for Linux. I just went to Adobe Flex Builder for Linux Forums looking for some sort of solution to an issue that keeps bugging me recently. I would say that FB3 Alpha for Linux works perfectly fine, there is no visual editor but I do not really need it, I could even buy it in the current form. But only when one issue would be fixed – the debugger that keeps disconnecting all the time.

The issue is that for unknown reason the debugger just disconnects when debugging AIR or Flex applications on Fedora, Suse, Kubuntu, Ubuntu and probably any other distro. It seems like it is a tough one or no one really cares anymore about FB3A. Just take a look at this thread http://forums.adobe.com/thread/112489. It was created on 28th of November 2007 and verified by someone from inside (http://forums.adobe.com/message/750458#750458, based on the fact that he says "We are investigating on this issue "). That person confirmed as well that there is a JIRA ticket for the very same problem. It can be found here http://bugs.adobe.com/jira/browse/FBE-184, opened on 19th of September 2007. It hangs on Internal Review status. Never resolved. For last 18 months.

It generally happens to be a major issue for all Flex developers working on Linux platform. The simpliest answer possibly is “we are using alpha software, we cannot expect it to work”. Fair enough. But here is the point of this post.

So what is going on with Flex Builder 3 for Linux? Is it abandoned? Someone asked that question a month ago http://forums.adobe.com/thread/203362. Never got a reply. It was not confirmed nor demented.

So please Adobe. Speak up! Paraphrasing Steve Ballmer: to push Flex you need developers, developers, developers!. You have plenty on Windows and OSX. You may have more on Linux. Just give them answers and show some support.

MySQL on AIR website is live

April 18th, 2009

I have just finished MySQL on AIR project website. It is available here: http://mysqlonair.gruchalski.com/. No release download yet, not all information is there. It is just a first step.

First release build should appear there withing next few days.