Archive for the ‘computing’ Category

Running JIRA under a multi-level context on Tomcat 6

Saturday, May 15th, 2010

I’ve recently started trialling JIRA – the issue tracking system from Atlassian. Fantastic looking product so far – I’ve done a lot of work with Bugzilla in the past, but it doesn’t compare when it comes to the sizzle that JIRA offers.

The installation documentation is incredibly extensive. Alas, I work in IT which means Murphy’s Law guarantees that the environment I’m given to work in will be unique, complex, and a million miles from a “Standard” setup. Consequently, I was dealing with reverse proxies, apache front-ends, https issues and more besides! :(

One issue that I did spend a while on was this one: http://jira.atlassian.com/browse/JRA-19051. Basically, JIRA has problems when installing on Tomcat 6 if you want to use a Context that is multi-level. So, something like “/servlets/JIRA” rather than “/JIRA”.

The fault is actually with Sitemesh that JIRA makes use of. Tomcat 6 uses a naming standard based on hashes as separators to specify a multi-level context. So, in the example above, the context XML and exploded WAR file is stored as “servlets#JIRA”. Unfortunately, this confuses Sitemesh who tries to drill into the expected Context directory structure and complains that directory “servlets” does not exist.

The issue linked to above is still unresolved and was raised in September 2009, so I suspect it’s probably a pretty low priority. I was able to work around it however by inserting the “<context>” stanza for JIRA in the main server.xml file rather than in a file of its own.

While this isn’t the preferred Tomcat way of doing things (any changes I make will require a Tomcat restart), doing the Context entry this way allows you to use the path attribute, where you specify the full Context path. Using a standalone Context file, you can’t use this attribute – it is inferred from the (special, hash-separated) file name.

I also used the docBase attribute to point to the exploded WAR file. I placed the exploded WAR file under the standard webapps directory, but nested to match the multi-level context path (so, something like …/webapps/servlets/jira, rather than the more Tomcat-6-normal /webapps/servlets#jira).

This was enough to get me up and running. I suspect it might also be possible to do something using an Apache proxy, whereby Tomcat thinks it is running single level contexts (/jira) and Apache proxies the requests to those single levels (so it converts requests for /servlet/jira to simply /jira). Unfortunately this wasn’t possible in the environment I was running in, so I haven’t pursued it any further.

Hopefully this run-down is helpful to anyone else who hits this issue!

Installing the Scala Eclipse plugin in Eclipse Europa

Tuesday, January 15th, 2008

This post falls squarely in the camp of “this was a gotcha that caught me, so I’ll blog about it so that I can Google the solution later”! :)

I’m in the process of getting my head around Scala, but when installing the Scala Eclipse plugin into my standard Eclipse Europa setup, I got the message that Scala Plugin couldn’t be installed because it required “org.eclipse.pde.runtime”.

I found a few references on Google, suggesting a full installation of Eclipse (i.e not a standard install), or reverting to Eclipse 3.2.

Instead I had success by:

  1. Go to search for new plugins with “Help” -> “Software Updates” -> “Find and Install”
  2. Choose “Search for new features to install”
  3. Select the “The Eclipse Project Updates” repository”
  4. Expand the “Eclipse SDK Eclipse 3.3.1.1″ category, and select the “Eclipse Plugin Development Environment”

This plugin includes the required “org.eclipse.pde.runtime” package, so once installed you should be able to get the Scala plugin up and running.

Now all I need to do is to relearn functional programming from my Uni days… ;)

Yet another Ubuntu convert!

Saturday, August 25th, 2007

I can only take so many mysterious disappearances of my wireless network. It turns out, exactly 146 disappearances! :) So, when my Vista laptop decided for the 147th time that I was connected to my wireless network “kind of”, I decided enough was enough!

There was a time when I was a Linux guy through-and-through. I moved back to Windows on the desktop when I got a new machine (although my servers stayed Linux…of course!). So, its fair to say I’ve been out of the scene for a while and didn’t really know where the state of the Linux art was at.

But thinking about it, 95% of my time on the laptop is spent surfing the web, doing email, and writing the odd document – Linux can do all those with ease. So, with nothing to lose, I used the new Vista functionality to shrink my C: drive, and went about installing Ubuntu Linux on the newly created space.

Wow! :)

So straightforward! I downloaded the ISO image, burnt a CD, and booted off it. 30 seconds or so later, I was looking at a Gnome desktop with a fairly full complement of available applications, and an “Install Ubuntu” icon. Great way to do things – you can try out the OS, see if your machine has any incompatible hardware, and if not, proceed with actually installing it to your hard drive.

Seeing no obvious problems, I hit install, and 20 minutes or so later I had a laptop which let you choose Vista or Linux at bootup, and proceeded from there.

The experience has been fantastic. From the get-go, my Dell Inspiron 6400 laptop could see all the surrounding wireless networks, handle sound (even the custom volume up/down buttons work a treat!) and had all the software installed to surf the web, read email, and write documents and spreadsheets.

Thats not to say it was all smooth sailing – getting the laptop to actually talk to my WPA-protected wireless LAN took a bit of work – the built in graphical client didn’t want to connect, but once I put the appropriate details in /etc/network/interfaces it was all good. That’s pretty much been the only hiccup!

Ubuntu running Eclipse

I’ve installed a few more things now – Google Earth is up and running (way to go Google, for supporting Linux!), the latest JDK is in, and my one indispensable piece of software – the Eclipse IDE :) – is up and running (pictured). This is one of the joys of doing Java development – the Operating System I choose to use is almost irrelevant – I don’t necessarily need to be running a system identical to my clients.

Since I’ve installed Ubuntu, there has yet to be a single reason to boot into Windows. Ubuntu even lets me read my Vista NTFS-formatted partition, so I can still get to all my music and documents. I suspect that what I may end up doing is setting up the laptop as a pure Linux system, with a VMWare image if I do come across something which absolutely requires Windows.

WordPress 2.1…and announcing a new Blog!

Sunday, January 28th, 2007

Had some fun last week installing the latest and greatest version of WordPress – version 2.1. And in related news, I’m announcing a new blog!

So, the technical details first – the installation was a snap. Just like the 2.0 series, a quick unzip and point your browser to a particular page, and minutes later the blog is up and running. From the admin perspective it feels like an incremental improvement – things seem a bit snazzier and smoother, but its hard to put your finger on any one “knock-your-socks-off” feature.

One item worthy of note is that the editor is much improved, so you can do your posts in the WYSIWYG editor reliably (I found the earlier incarnation a little flaky – so much so that I turned it off, and did my posts “manually”).

In terms of the new blog, this setup was all about bringing the latest incarnation Low Impact to life. A while back, I’d noticed that more and more of my posts had an environmental leaning which, while not clashing particularly, were starkly different from my tech-related posts. So, as an experiment, I setup a blog on Blogger called Low Impact.

I got a lot out of the experience – enough to know that:

  • I liked the setup of having a specific blog for environmental topics, freeing up dasman’s World for more tech-related postings, and
  • While Blogger is a great site, nothing beats having full control of your own website!

So, the domain was registered, a webserver setup, and WordPress 2.1 installed.

Low Impact’s purpose is to provide postings specifically about reducing our impact on the environment. If that’s a topic that interests you, you might want to check it out!

3 months of news

Saturday, January 20th, 2007

Certain nameless colleagues have been curious as to whether some sort of terrible car accident had severed my fingers, thus preventing me from writing blog entries over the last 3 months, so this post is all about the incredible things I’ve been getting up to since then on the computer front.

Hmmmm. Let me think….. *scratches head* There must be something….

  • I’ve continued to spend far too much time cursing at J2ME. When it comes to UIs, you either have full, low-level control where you draw every single pixel yourself, or you have almost no control where you populate a Form with Items and wonder what on earth it will look like on the various platforms. If only there was a happy medium… :( And yet, despite my complaints I can’t walk away – the lure of knowing your program can run on potentially so many devices is too much!
  • I gave NetBeans another shot for my J2ME development with version 5.5, and decided all is forgiven. It feels way “snappier” than version 5, and I haven’t had it hang on me while using the Visual Designer part of the Mobility Pack (which is the killer feature for me). Good work guys!
  • I’ve upgraded Wordpress around 50 times to cope with all the dot releases that have been coming out. I’m actually getting a bit excited about the big 2.1 version due out soon – I have a sister working overseas who has been a blogger in the past and toys with getting back into it – perhaps a snazzy new piece of software will be the impetus she needs!
  • I finally decided to sit down and tick off something thats been on my To Do list for about 6 months now, and upgrade the search page at www.asman-it.com.au to use the new “inline” Google search results. And, like all things you put off for ages, it took around 10 minutes (although admittedly my page won’t win any prizes for aesthetic or robust web design!).

So, we’re back up to date. Perhaps my next post will be a little more on-time! :)

Upgrade to SpamAssassin 3.1.5 a big success

Monday, October 2nd, 2006

It was around a year ago that I put SpamAssassin into my site-wide email setup, and at the time had been pretty happy with the results. The combination of SpamAssassin at the server, and Thunderbird’s spam detection at the client was pretty effective. But over the last 6-8 months especially, the spam situation had been getting a lot worse – around 100 spam messages were making it past the mail server each day. Thunderbird did its best, but there were still 20 or so spam messages that ended up appearing in my Inbox.

So, taking advantage of a long weekend here, I decided to upgrade SpamAssassin.

Wow.

This morning, I opened my Inbox to find 0 spam messages. And a quick look at my “Spam” folder showed that 65 spam messages had been caught – the majority of which had been caught at the server. The new setup has only been running for 10 hours, but that certainly looks promising!

Upgrading to the latest engine no doubt helped, but there have been two specific “extras” that I think are making a big difference.

  • I’ve added the Net::DNS perl module to my system – I gather SpamAssassin uses this for RBL lookups and the like. When I first installed SpamAssassin, I didn’t bother with this – it lists a pile of optional modules you’re missing, but is happy to build without them. Net::DNS is one of these “optional modules”. I’d recommend you consider it mandatory! :)
  • I’ve enabled Bayesian filtering. This is the feature that allows SpamAssassin to “learn” which messages are spam. It is a bit of a fiddle – permissions in particular are the big gotcha – but I’m hoping that this will also help keep my spam defences “ahead of the curve”.

A BBQ Shape…with the Lot

Thursday, September 28th, 2006

Forgive the indulgence – this posting can’t be described as informative or even useful in any way….but I couldn’t resist!

So, as all serious programmers know, you need fuel when your churning out top-quality code. Salty, calorie-laden fuel! Some swear by pizza. Others are into chips. BBQ Shapes are my programming snack of choice. I love it when you get one that has a lot of the “topping” – that salty red powder that gives ‘em their flavour!

But you can have too much of a good thing. Tonight, I reached into the box and pulled out a handful of Shapes to find, well….this:

BBQ Shape with the lot

(I promise, the biscuit is not a setup, thats how it came out of the box, and that spice “stuff” is packed on there like cement!)

Wow. Next step is to put it up on EBay, right? Surely there’s people who’d pay good money for that sort of “flavour explosion”! :)

CELLular – A J2ME implementation of Conway’s Game of Life

Tuesday, August 29th, 2006

I’ve been looking for a simple way to play around with the GameCanvas – the double-buffered general purpose canvas that comes in MIDP 2.0. And being a geek^H^H^H^H person interested in esoteric things, an implementation of Conway’s Game of Life seemed like a good project.

In case you’re too lazy to click on the above link to the Wikipedia page, this is an example of Cellular Automata – a grid of “cells” that live and die according to simple rules. And interestingly, from very simple rules all kinds of ordered and complex behaviour emerges. Short summary? Its like a kind of fishtank for geeks!

CELLular (neat name, huh! You get it, right? CELLULAR automata. CELL phone. Huh? Huh? :) ) allows you to generate random grids, or to draw your own patterns, then set them in motion. And, as an added bonus, it does a nifty fade-in/fade-out effect as cells are born and die! ;)

Here’s a picture of it “in action”:

CELLular in Action

You can download CELLular here, and it should hopefully run on most MIDP2.0 devices. Enjoy!

Java Sudoku Solver in 6 lines

Monday, July 24th, 2006

After playing around with writing Sudoku Solvers in the past, I was interested to see this page which details a number of tiny sudoku solvers in a variety of languages such as Perl, Ruby, etc.

They have a few basic rules – no line over 80 bytes, etc, etc. And the examples take their input as a string of 81 digits, which represents the 9 rows of 9 digits, with “0″ being a blank square.

As I apparently have way too much time on my hands ;) , I got up the motivation to convert one of these examples into Java. The results?

  • The end program is around twice as many lines as the Perl original, and
  • Yup – you can make Java programs as unreadable as anything else out there! ;)

There may well be shorter possibilities out there – I didn’t put in a great deal of effort past converting the Perl original. But, for the record:

import java.util.*;public class S{static char[] A;static void R(){int i,j;for(i=
0;i<81;i++){if(A[i]!='0')continue;HashMap h=new HashMap();for(j=0;j<81;j++){h.
put(j/9==i/9||j%9==i%9||(j/27==i/27)&&((j%9/3)==(i%9/3))?""+A[j]:"0","1");}for(j
=1;j<=9;j++){if(h.get(""+j)==null){A[i]=(char)('0'+j);R();}}A[i]='0';return;}for
(i=0;i<81;i++){System.out.print(A[i]);}System.out.println();System.exit(0);}
public static void main(String[] a){A=a[0].toCharArray();R();}}

Assuming you have an appropriate classpath, you can run it with a line like:

java S 006070800000000000078601520030405010400000002090302060052103690000000000003020100

This code was converted from the excellent Perl example at:

http://www.ecclestoad.co.uk/blog/2005/06/02/sudoku_solver_in_three_lines_explained.html

Nice article on game console power consumption

Monday, June 19th, 2006

Following on from my posting on my new centameter power usage monitor, I came across this interesting article at www.dxgaming.com.

They did some testing of the power consumption of common consoles and made the discovery that the latest consoles use between 5 and 10 times more power in standby than their predecessors – so, an XBox uses 0.4W in standby, but the new XBox360 uses 2W. The Playstation and Playstation 2 is a near identical story. They have an interesting discussion about why these figures may make you switch off your Playstation 2 when not in use, but not your XBox360 – worth the read.