Tuesday, August 12, 2008

Converter cannot be used with JSF checkbox

ran into this today, turns out, it is a spec issue, basically, getAsString gets called, but getAsObject doesnt. Spec issue details.

Friday, July 11, 2008

Get Your iPhone today! or not!

I just passed by the Pasadena Apple store on my way to work, and there was a line extending around the building for the new iPhone 3G! Call me crazy, but I would never wait more than 10 minutes in line for a phone, even if it has an intelligence that knows the answer to life, the universe and everything :P . I am planning to eventually get one of those, but come on people, the line looked like the line for buying the daily bread ration back in my home country of Egypt...

Monday, July 07, 2008

XMPP meltdown

If you are using Adium and is using XMPP DO NOT upgrade to 1.2.6+ or 1.3b6+ , they have a critical error that wont go away unless everyone on your contact list has upgraded to 1.2.7 / 1.3b7... It's an xml parse error and the handling is actually only fixed in the next version, so I preferred to wait it out after rolling back.

More here...

Tuesday, June 17, 2008

And a new earth across a wide ocean...

Ok, lots have happened since I last posted here, new job in a new country, relocation woes, I think I have enough time now though to revive this so very dead blog :) .

Monday, June 11, 2007

Tomcat 6 and endorsed dirs

A major change between tomcat 5.5 and tomcat 6, and a one that has been poorly documented IMHO, is the removal of the endorsed dir from the dirs that are loaded by tomcat, if you are migrating from 5.5 to 6 and you are getting ClassNotFoundException, it maybe because you have some libs off /common/endorsed, this directory has been removed and even if you add it, it will not be loaded by default.
My case was a bit more complex, I was upgrading Liferay 4.2.2 from using 5.5 to 6.0, I kept getting XML parse errors and grammar not found exceptions, it turned out that Liferay loads Apache Xerces off endorsed dirs and since those were not being loaded anymore, apparently it was falling back to the J2SE 1.5 XML parser instead of complaining about class not found.
Solution? very simple, either move your stuff elsewhere, like /common/lib, or add the path to common.loader property in /conf/catalina.properties.

Friday, May 11, 2007

Using Apache Ant for Text Manipulation

I had to spend time last week making an automated build script using Apache Ant, and while Maven is closer to my heart, due to some reasons I shouldn't bore anybody with, I had to use Ant. The experience overall was not painful, during the course of writing the script though, I had to do a lot of text manipulation, this was what took most of the time, and resulted in a few quick pointers I want to share about using the ant tasks replace, replaceregexp and XSLT:

  1. Replace task
    • I had some special characters in the replace token that I had to escape, escaping them xml/html style is no fun at all , especially when doing a multi-line token, an easy solution to this is to enclose the token in ![CDATA[]] which will allow you to use any special character you need without escaping.

  2. ReplaceRegExp Task

  3. Now this is a tricky task especially when doing complex regular expressions, two things I had to learn the hard way:

    • You can't use \n or any other know line separator, you have to use ant's ${line.separator} to signify a new line.

    • You have to escape a dollar sign with another dollar sign ($$) to signify a regular expression $ token, otherwise it is parsed as the ant's one.


  4. XSLT Task

  5. Didnt do much with this one, only thing of note is that the default xml parser will not handle xml that is not well-formed (the tomcat configuration files in my case) and you have to replace that.

I am at it again!

Ok, second attempt at a blog here, after the first one fell apart after a few months of sporadic postings due to a host switch. Nothing was worth salvaging though (interesting thought: a few months worth of rants and nothing worth salvaging!). Anyway, here I am, poised to bore the occasional surfer (again) with useless rants about my daily adventures in the FOSS universe. Look out world, here I come!