Archive for March, 2004

"Pro Jakarta Commons" book

Friday, March 19th, 2004

Something to mention. Last 6 months or so I’ve been working as the technical reviewer on a book on Jakarta Commons from Apress by Harshad Oak.

It’s called Pro Jakarta Commons and is available from Amazon and Bookpool, though the latter don’t have it in stock yet. Amazon have a 30% off price though, which is good for them.

I consider the book to be perfect for someone who has not got into the wealth of code in Commons yet and is looking for a book that is packed with code examples.

Obviously it’s of use to any other Commons user too. The source code is available too.

Genesis: Building and deploying

Thursday, March 18th, 2004

One of my areas of interest over the last 6 months at work has been in creating a build and deploy system. We use Maven and CVS exclusively and our admins, who remain the only ones with production passwords, are not particularly Java savvy.

Thus was born first ‘Portify’, then ‘Buildify’, then in union with the nightly-build system I wrote in the previous year, ‘Genesis’. I have permission to open source it, so can happily talk about it, though there’s one major reason for not doing so yet. It’s all in Bash currently :)

I had some major aims:

1) Must be of use to developers for their Windows/whatever boxes, just as it is to the administered Linux servers. I hate that lessons learnt in one environment were not being shared, and that new developers were not able to be given a version of the product to start work on.

2) Builds an ‘application’, not just a bunch of wars etc. JBoss configuration, streamlining, lessons all get integrated into the application on each build and deploy. The bad side to this is that each application is 30Megs or so in size. A relatively, but not completely yet, stripped down JBoss. The aim is to have it work with any container, though JBoss 4, 2.4, stand-alone and oscube [an unreleased osjava container that sits on top of jndi] are likely to be the next to be tried.

3) Must be easy. Currently the process involves two top-level bash scripts, a directory move, scp of files, unzipping of said files and starting.

Of these, 2) is definitely the most arguable. Bear in mind, we don’t have Java admins who are writing their own Log4j evaluators and researching JBoss. It’s done by the developers. This helps to keep the production systems under control without giving developers production access.

All of this is based on CVS. An application is made up of many cvs modules, as defined in an application.desc file which maps a cvs module to a tag/branch, where HEAD is just an oddly named branch. In addition to building the code, which is done via a standard ‘maven clean genesis:build’, where genesis:build is a goal-link to whatever the real build-goal is, a ‘deps-zip’ goal is performed which collates all the dependencies that exist [outside of a war] according to a genesis.runtime property being true.

These are sucked together into a ‘conf/ deploy/ deps/ lib/’ structure for each application in a product. This is buildify at an end. These are then transferred to portify, which takes the build-elements and applies them to a container of some kind, ie) JBoss 3.2. At the same time, a target-environment .properties file is used to configure the container. These are then all zipped up.

Payload, an osjava release, http://www.osjava.org/payload, has been created to be used instead of the zip. It is a self-extracting jar which performs s+r on the files as they are extracted. This means that one portified container will be installable on many platforms, removing the worries of a QA/Staging build and a Production build being subtlely different.

Information about the applications, versions and configurations, are deployed as a part of the applications.

It’s been a very agile piece of work, with parts going into operation last October despite other parts only existing in my head. By putting those early pieces into active use as soon as possible, it helped shape the system. I largely did this by doing by hand what would one day be a script. Arranging build files instead of going directly from CVS.

The admins will get to use it for the next project that starts imminently, so I expect some grumbles there. 3 other developers have been using it in the last month or two, so hopefully most are dealt with.

My next decisions are where to go next. The payload part needs applying, and I need to port it to a platform-independent language. I had always planned to write it in Ant, but Groovy is very tempting too. It could just all end up written in Java too, though a scripting language seems a better fit.

Why this ramble? Because I can. By which I mean, because it’s something at work that is open sourceable, and unlike Scraping-Engine or ReportRunner [other ideas at work that are available to open source when I find time], will not suffer when business directions change.

Groovy Ruby Python

Tuesday, March 16th, 2004

So after 3 years of not learning new cool languages, C# or Ruby was my last, I find that not a lot has really happened. Groovy is around now, as the JSR email reminded me, but other than nothing seems to have changed much. Jelly I guess, which I’ve been using at work.

Time for a new strategy. Using lots of different languages at work is unprofessional, but at home I can hack around. So I’ll have a list of languages:

Perl, Python, Ruby, Groovy, Rebol

And each new script or whatever I do at home will choose the next in line. If it turns out to be a bad fit for the problem [say Rebol GUI stuff where I have to pay for the GUI perhaps] then I’ll move to the next in line. If something becomes reused a lot, I’ll port it to multiple languages.

Doubt I’ll be able to maintain it, but who knows. I can’t think of any other way to get more proficient when Perl, Java and Bash/unix-cmd-line handle most of the issues I have.

Booq Bag

Monday, March 15th, 2004

By the way, I got a new bag for my laptop et al at the weekend and it rocks.

It’s the BP3 System from Booq bags. The only difference is that I’d prefer another cellphone case to put the iPod in, and realise I have little use for the superb laptop sleeve as the bag has a great laptop enclosure.

Guess it’ll be of use when I carry more than the normal :)

Amazon web service

Monday, March 15th, 2004

Bugger. Just spent a while looking into the amazon web service as an easy way to get a book database [ie I have the isbn’s, I want the name of the book].

All looks good, except that by turning the isbn into the name of the book, I have to link each name to Amazon and may not link to competiton such as Bookpool or JavaShelf [though JavaShelf lack an ISBN based URL].

Takes me back to working in a bookshop when I was 16 in the UK. They had a subscription [not cheap I think] for micro-fiche containing a list of all currently published books in the UK. I think Bertrams were the company who shipped it.

Shame that that kind of information is still locked away. I guess I need to decide between a little typing and enhancing Amazon’s sales to save a little bit of effort and do it ‘properly’.

Oracle bombs out…

Sunday, March 14th, 2004

Well, Oracle 10g fails to satisfy me too:

***************
hen@rhino:~/downloads/oracle/Disk1> ./runInstaller
Starting Oracle Universal Installer…

Checking installer requirements…

Checking operating system version: must be redhat-2.1, UnitedLinux-1.0 or redhat-3
Failed
Exiting Oracle Universal Installer, log for this session can be found at /tmp/OraInstall2004-03-14_01-21-42PM/installActions2004-03-14_01-21-42PM.log
*****************

Nice of them. To only run on the expensive ‘enterprise’ aka pathetic versions of Linux. I’m guessing that even if the installer were to attempt to run, it would have the same kind of problems that installing 9i on redhat-ES-whatever has. With glibc’s, binutils and various other things needing special Oracle patches.

It’s amazing Oracle don’t ship their own Linux “Oracle works only on this Linux”.

It’s hard to decide which of Oracle or MS leave me more irate.

[I’m using SuSE Pro 8.2 by the way]

Trail taglib announcement

Sunday, March 14th, 2004

Should have mentioned this a while back, but I’ve been trying to decide what to do blogwise for a month now. Move to Roller [I tried the javalobby service, promptly forgot password and there’s no way to get it back], upgrade MT, install my own JRoller.

Anyway, in a kind of pet-store application for work to define how we use all the technologies in a basic webapp, I created a dynamic breadcrumbs taglib. Nothing else out there attempts to deal with breadcrumbs this way, so it’s released at:

http://www.osjava.org/trail-taglib

Exploring Windows (and a little Oracle)

Sunday, March 14th, 2004

In the latest DDJ, I received a Unix->Windows education CD with a copy of Windows 2003 Server. Why not I thought.

So I installed the 6 month trial of Win2k3 and was impressed with the install. It was all quite easy to do, there was only the one section with questions [I left the machine alone until the next day and was surprised to see that it was ready for login] and it had a nice manage-your-server application that opened immediately.

I was impressed that nothing was turned on by default, and I installed IIS relatively easily.

So… all pretty good so far. MS finally matching the ease of use of a SuSE install and the manage your server app must match the OS X Server equivalent [not that I’ve tried it].

From this point on, it was all downhillMy aim was to learn IIS, SQL Server and Exchange. I’ve played with SQL Sever 2000 before and found it pretty easy, much easier than a recent install of Oracle on Linux.

IIS. Pain in the arse management application. Very tricky to comprehend. Despite much experience of Apache and other servers, the GUI console was not simple and I’m pretty sure I’ll have to grab a book or something to figure out how to do things. Like create a web-site.

Exchange. A lot of time spent downloading [again MS beat Oracle, whose download sites were down] and an installation that once I’d battled through the odd checkbox install sheet, preparing the system, discovered that my Windows machine had to be in a domain. So no Exchange until I figure out wtf domains are all about and how to setup a primary domain controller [I’ve heard people mention the phrase].

SQL Server 2000. No go. It doesn’t run on the latest Windows server.

So…products that cost far more appear to be…far more painful. More money equals better marketing departments?

Oracle stuff works today, so I’m downloading Linux 10g [there is no Windows version of 10g preview], which will hopefully be installable unlike Linux 9i. When the Installer needs half a dozen patches to get it onto its main target platform [Red Hat ES…], I dread to think how hard it is to work anywhere else. Attempt is to see if JDeveloper is worth any effort.