Building Java Applications with Windows Azure

Looking for a place to host my own home grown apps, I came across an interesting presentation about using Windows Azure cloud to run Tomcat and a JVM in the Microsoft cloud solution. See Building Java Applications with Windows Azure

The presentation basically says Azure can run any native code, which means java.exe and tomcat.  Native programs that runs off a batch file with no specific registry key or lowlevel system dependencies or installers are more likely to run in Azure.

Azure has worker roles and web roles.  Web roles are used for hosted apps with .net/php and IIS and not used here, however the worker role is used to run native code.  It can be bound to a network port (ie port 80)

The Microsoft support comes in with an Eclipse plugin to access your resources in the cloud from within Eclipse.  There is a jar that wraps up the RESTful interface to Azure that your app would normally use to access the clouds resources with Java helper classes and provides some other .NET helper classes.

It also comes with some helper stuff to setup Tomcat – ‘Tomcat Solution Accelerator’ – to configure Tomcat to make it very light in terms of OS dependencies.  It also has monitoring of Tomcat to let Azure know to restart the app if it fails and also help indicate to MS there is a problem with the particular server that instance in their cloud is perhaps not working as it should.

I do like that you get to choose the versions of Tomcat and Java you want, and there doesn’t seem to be much of a reason you couldn’t apply this to other languages and appserver environments.  (Grails/Jetty? – and hopefully Glassfish, but that may need a bit more config work to pack it up and install on the cloud).  That last point sounds a bit negative, you could probably get a service on a VM linux host that means you dont have to fudge around so much, but still the novelty polyglot value of having JVM and .NET in the same cloud environment may actually outweigh the negative of the DIY setup.  The presentation explains how the Tomcat is packaged and shows the contents of the packaging scripts to give you an understanding of how to do the same for another appserver.

One nice thing about the Azure platform itself is that you have production and staging slots – you can have a production app in the cloud, and also a staging version too – and swap them over when you are happy with Staging.

The other aspect is the queues/worker facility to allow for concurrency when running your app across multiple nodes, asynchronous architectures and scalability.

To try it out, you’ll get free access to Azure while its in CTP status (till Jan 09), and then MS will start asking for money. Apparently, Dominoes pizza is testing out their next version of their ordering webapp on the platform, if you wanted a vote of confidence too

Azure Java SDK available here: windowsazure4j.org

Choosing a PHP Shopping Cart

I needed to select a shopping cart application for an associate.  This blog post provided a nice view of the PHP shopping cart landscape.  My limitation was using PHP 4 and MySQL 4 and I wanted something simple that looked good with out the need to splash a lot of paint on by way of css or template files.

StoreSprite turned out to be the tool of choice that fit all the above criteria.  It was full featured, with a reasonably simple UI for shop admin first timers to get their heads around.  I did experience some issues getting the Paypal sandbox to work for testing, and it lacked support for different shipping rates to different state/territories (different shipping rates for different countries is supported though).  However we were able to work around those issues to be able to deploy a site using it and having a happy business owner who went from updating a static html page with Paypal buy now buttons to a dynamic site where they dont have to see any html again.

To address the above limitations, I would use a more mature product like Magento.  It did support the shipping types we were after and its pluggable architecture and open source code meant it much easier to support with a strong community and plugin base.  However, it does need PHP 5 (although a workaround to include PHP 5 binary files to get it to work on PHP 4 servers is mentioned on their wiki).  Also, while the UI is more polished, it would be more difficult for the beginner to get to terms with.  I found, that the more full featured a shopping cart app gets, the further the admin UI is separate from the user UI, both in terms of the domain used, and the mental picture of how things are connected.  For example, StoreSprites menu’s are clear cut – Settings, Products, Content but Magento’s seemed to have a few different areas for the same thing – where are the shipping settings, are they are plugin setting in the Store menu, or in the Products menu.

The other alternatives I looked at were OSCommerce and ZenCart that come bundled as ‘One Click Installs’ with many a hosting provider offer.  However the default theme was stale – very crowded and lots of options to setup the different sections of the site.  It made things more time consuming than they had to be.

How does your CIO measure up?

From HP Technology at Work newsletter article here

“While it’s true that alignment has improved and IT is more business-smart, the majority of business leaders remain fixed in their view that there is business work and IT work,” she writes in her white paper Circa 2015: The CIO of the future. “Without a change in this mindset, the IT-smart digital natives that are starting to populate the business ranks will have little positive impact on the future of IT.”

Couldn’t have said it better myself 🙂

Windows XP SP3 Activation Issues

My father’s PC recently died and needed a new motherboard.  Taking the opportunity to upgrade, we put in new RAM, CPU, but left the old hard drive.

Using the old hard-drive, the PC would go to boot and restart half way through the boot process.  This was the same in safe mode as well.

A repair install was the best way to go, so I downloaded a XP SP3 retail image from Technet and wen’t along with the install process.  All seemed to go well until the next major reboot after setup is complete, a smaller than normal Windows logo with a Please Wait… message at the bottom.  This did not go away so after half an hour, I reset the PC.

The Welcome screen showed up, I thought all was well.  I went to login as my user and a prompt appeared telling me that Windows needed to be activated before I could login.  I chose Yes and allowed it to do its thing.  My backdrop screen appeared, and there was a lot of disk activity for about 10 mins, before it then stopped doing anything useful.  It just sat there.  I could move the mouse and nothing more.

I’ve experienced a fair few encounters with WGA and most of the time, the fix involved getting to the registration wizard, by starting it from the Start->Run prompt.  Once there, Windows could do its thing.  Without a working explorer, no control+alt+delete to bring up task manager, I could do nothing.  You cant run the wizard in safe mode either, and whilst there are some hacks to bring up a command prompt in the welcome dialog and lots of other workarounds, nothing I tried worked.

In the end I simply installed XP SP2. Because it came with IE 6 or 7 though and the installed IE was version 8 there were periodic program exceptions regarding a synchronisation app (i think what IE 8 uses to keep its RSS feed list up to date).  An upgrade through windows update to internet explorer fixed that but we were reluctant to change anything.  In the end, I bought Dad a bigger harddrive, a proper copy of Win7 and haven’t had to worry about it since.

Why is it so hard to get anything done?

My favourite subject, what the business wants VS what IT wants?

The analogy of the expectations of a coffee barista and their ability to deliver their service is used as an analogy to that of the business has a service in mind from IT that needs to get delivered according to a set of reasonable parameters (timeliness, cost, value for money).  IT on the other hand have an agenda of logic and process, which doesn’t gel well when business requires innovation and doesn’t have the rules or the process in place themselves.

I think personally the biggest barrier is that the business sees IT as a service and IT sees business as a consumer/customer.  Yet they are all on the same team and the goals of business sustainability, profitability and efficiency are all shared and equally valued.  There needs to be a bridge, and I dont mean of the heavy BA role variety. 

The bridge as I see it, is the increase in toolboxes.  Business for whatever reason innovate within the spheres of people, interactions and workflows, but either abstract too far or are focused on existing implementation when it comes to involving IT style solutions in their innovation.  Perhaps as our current Gen Y workforce begin to move into management roles that shape business thinking, they will have an IT acumen and understanding of the tools and patterns that can take a business workflow and cut out the redundancy – they’ll know what to ask out of IT better because they’ll be able to ask for the right shaped tools.

I’m not saying that IT should just be a bunch of monkeys coding to whatever requirements waiting for these super Gen Y managers to come up through the ranks and lead us out of bad requirements / bad direction hell.  IT need to step up into the business strategy to do the same thing – innovate with the business – show them where the efficiencies and sweet solutions lie.  And really instead of being put to task with what the business wants (an extension of a business domain area for example), they should innovate with the business, put to task on how to grow the company, taken out of the tunnel vision project and given the autonomy and self direction to grow the company.

The article asks something of IT which is important – professionalism and knowledge.  Having barrista’s scratching their heads about how to perform a request indicates a lack of experience and knowledge.  IT people know how to be innovative, but they don’t necessarily know how to innovate within a business environment where they have constraints on time, directions by different stakeholders, but to also be innovative, you have to be timely.  You cant be timely if you don’t have the experience or knowledge to respond in a timely manner.  But in order to be useful to the business, you need to be.

At the end of the day, my half baked utopia is that IT are the business decision makers, and conversely the business decision makers are also IT people.  Those companies that can leverage best of breed can at the very least save some unnecessary time and interactions.

Mounting a Loopback Device Image

This is what I used to mount the Mandrake Pendrive Linux loopback device to retrieve my partners files when she moved back to a proper PC with a working hard drive 

# Create the device as /dev/loop0 and point to the loopback file
losetup /dev/loop0 Desktop/mcnlive.loop
# Mount the device in the usual way
mount -t ext2 /dev/loop0 Desktop/vfs

Firefox Keyboard Shortcuts

Following my previous post on IDEA keyboard shortcuts, I was inspired to look for the same thing for Firefox.  In particular I use the Copy URL function a fair bit but saddened to learn it doesn’t have a shortcut provided out of the box.

There is the keyconfig addon that provides the ability to look and add keyboard shortcuts to functions.  Strangely you cant change a shortcut, only add new ones by default. However, there are addons for this addon 🙂 that allow you to set shortcuts to actions that normally don’t have such functions.

Firefox as it stands

KeyConfig Extension

Functions for KeyConfig