Monday, December 28, 2009

Trobleshooting Hudson and Ant

[catalog-server] $ cmd.exe /C '"ant.bat -file build.xml install && exit %%ERRORLEVEL%%"'
'ant.bat' is not recognized as an internal or external command, operable program or batch file.
Finished: FAILURE

1) The machine which runs Hudson might not have ANT installed on it.
2) If ANT is installed on it then you might not have set the ANT_HOME variable.
3) If ANT_HOME is set, then you might not have set %ANT_HOME%\bin as a part of the system PATH variable.
4) If that is also set, then you may have started your application server (tomcat\hudson) before you performed steps 1-3 so the changes haven't taken effect yet, try restarting it.
5) No good? You may be starting or stopping the tomcat container as a windows service BUT the user under whom the service actually runs may be a different one! This means you need to log that user out and then back-in for him/her to pick up the changes made to the system variables like ANT_HOME or PATH. You can simply reboot your machine if you don't know who that user is or what their password happens to be.
6) No luck? Goto Hudson > Manage Hudson > Configure System > Ant and fill out a value for the ANT_HOME variable and then click Save.
7) Still no luck? Well go to the Job in question and then goto Configure > Build > Invoke Ant > Ant Version and change it from (Default) to the one you configured in the previous step.

If this is not enough try having a look at: http://blog.mxunit.org/2009/05/ci-with-hudson-cf-and-mxunit.html

Sunday, November 8, 2009

XAMPP and Facebook

Ah yes, this is the perfect example of why XAMPP is so god-damned great: A few days ago yours truly, was intrigued by the buzz around Facebook and its application framework. After some light reading, what seemed like a long and perilous road became a surprisingly short exercise in flipping a few switches and copy/pasting past it all to get a taste of what it feels like to be a Facebook Application Developer.

Here's the breakdown:
  1. Get a Facebook account and login to it.
  2. Add Facebook's Developer application to your profile.
  3. Go through the motions of creating an application with Facebook which is really nothing more than a registration process of sorts.
  4. If you understand the Anatomy of a Facebook Application then you know that the two most important components for creating/registering an application in/with Facebook are:
    1. Callback Url
    2. Canvas Page URL
  5. Get XAMPP. (I know the site looks shady but I'm not their UI guy.)
  6. If you don't have a domain name, simply login to your home router and figure out your real IP address.
  7. Edit your router's Port Forwarding settings to allow connections from the outside world to come in to your computer at port 80.
  8. Startup Apache from your XAMPP install and perform a quick sanity test to see if you can access the default web site.
  9. Take the source for a default index.php page provided by Facebook and throw it onto your machine and point your Apache's httpd.conf file to it. Also throw down 3 more PHP files that make up the Facebook client libraries.
blah blah blah