>> Monday, 9 March 2009
I've been meaning to give Mango blog a whirl for a while now and as I'd just been given some server space by my pal Mark Drew (twitter:@Markdrew) for one of my pet projects I thought why not so this weekend I tasked myself with getting it up and running.
Now I have to say first and foremost I love the way Mango is installed. It's nice to see a CF app give as much care and attention to the install process as some of the bigger OSS apps from the PHP arena (Drupal, Joomla, Wordpress etc.) just unzip, upload and browse to the document root to view the installer.... perfect.
However after the hassle-free installation I immediately ran into a problem when trying to view the frontend site that left me scratching my head somewhat. the error message was...
Nice and generic eh? Well I muddled about trying various things such as uninstalling and re-installing it to the webroot instead of a sub folder, installing it without using a prefix on the db tables. nothing seemed to work. I then consulted Google looking for an answer and found a similiar problem posted up on the Mango blog forums that suggested it may be an issue with the data in the db table concerning links. So I checked there and found nothing amiss and by this point I was at a total loss what to do.
"Can't cast String  to a value of type [Array] Java type of the object is java.lang.String"
Luckily for me James Buckingham (twitter: clarkee21) was experiencing the exact same problem when attempting to install Mango Blog on Railo 3 using MySQL as well. We exchanged a few messages back and forth last night about the problem and then I eventually gave up and went to bed. However James contacted the extremely helpful and lovely Gert Franz (twitter: Gert_Railo) from Railo and between them tried some bits but it was Laura Arguello who came up with the suggestion that it was down to a setting in the Railo datasources configuration section concerning the preservation of single quotes within the cfquery tag in the Mango Blog support forum here.
A quick trip to the datasource page under services in the Railo web administration panel to uncheck the box marked 'Preserve single quotes' and presto! all was now working.
I thought I'd mention this on the blog so people can find the solution if they do a search as I struggled to find anything pertinent when I attempted to do so.
It is also worthwhile to note that this setting affects ALL datasources in your context.
If you experience similiar problems when running your own code then you can also programatically set this option for each query by adding the following option to your cfquery tags
Hopefully this post will be of use to someone as it would be a shame for someone to hit this minor stumbling block and swear off either Railo or Mango blog because of it as they're both pretty damn great if you ask me.
until next time...