Archive for the ‘Open Source Software’ Category

Interesting Problem with log4j, Tomcat and NullPointerExceptions

Monday, August 24th, 2009

log4j.jpg

I ran into a very interesting problem today with NullPointerExceptions and log4j. Specifically, it seemed that I was getting NullPointerExceptions on calls to log4j. I couldn't believe it at first, and I did several things to "clear up" the error, but the NullPointerException persisted on the statement:

  log.info("Time to clear the daily data.");

and in theory, that shouldn't happen when we defined at the top of the class the value for log:

  protected static Log  log = LogFactory.getLog("my.package.ClassName");

It should just always be there. Very odd.

So I hit Google and got a really good hint from one of the answers there

...when using Tomcat, it will unload the ClassLoader that held the webapp, and if you 'un-deploy' the webapp, and maintain the thread, it'll keep going. However, it's lost it's static variables in the unloading and now you're going to get a NullPointerException.

Since there is no way to close out the class that's loaded and instantiated for an H2 trigger, I had been just shutting down the chat interface of the alerts. But what I needed to do was to kill the alert thread(s), and then stop them for good, and clear all references so that they could be cleaned up.

So I did just that. I'm thinking that this is going to make a big difference in the overnight roll-over, as we'll have shut everything down and if the class loader had been dropped, there's no chance of it making a call and getting a NullPointerException.

MacVim Snapshot 49 is Out

Monday, August 17th, 2009

MacVim.jpg

The guys working on MacVim have been busy once again, and released Snapshot 49 (actually 48 and then 49) to refactor the keyboard code and make it a little more international-friendly as well as allowing key bindings on more key combinations. Interestingly, this also ends up help us ASCII folks, and that a nice perk.

Still one of the bet editors on the planet.

Security Update to WordPress 2.8.4 at HostMonster

Thursday, August 13th, 2009

wordpress.gif

Well, this morning I read about an exploit for WordPress 2.8.3 that allows a user to change the admin's password, and effectively lock them out of their own account. Pretty nasty stuff.

Thankfully, SimpleScripts had WordPress 2.8.4 ready to go and I was able to quickly update my installs to the version with the fix. Whew!

Updated Boxes to Git 1.6.4

Monday, August 10th, 2009

gitLogo_vert.gif

Given that I've looked at Mercurial and decided against using it as my main distributed source control system, and my version of Git was 1.6.0.2, I decided to update to the latest version of Git which was 1.6.4 on my laptop, my Intel iMac at home, and my gitosis server at home. It was just time for an update. Plus, I've read that the newer versions have pulled quite a bit of the old wrapper code into the C codebase so that things are more compact and faster. All around, it looked like it was time to upgrade and get on the latest features.

The updates for my laptop and iMac were easy because there's a Google code project for a Git installer for Mac OS X. It's as easy as downloading the package, installing it and running with it. Sure, there are a few things that you might want to do if this is the initial install of Git, and I've documented these previously. But an upgrade is easy-breezy.

The update for my OS X 10.3.9 box, frosty, at home is about as easy. Again, since I've built 1.6.0.2 on it before, it was as simple as:

  curl -o git.tar.gz http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz
  cd git-1.6.4
  ./configure
  make
  sudo make install

and we're off an running. Yeah, the docs aren't updated, but that's documented in the previous install, and I use my laptop for docs more, anyway.

Getting gitweb updated was pretty simple - just like the original install and it's in the Git distribution. One thing I liked about this time is that I'm a lot more savvy about the use of CSS and layout, so when I updated the code for gitweb, I fixed up the HTML for the gitweb header to be:

<div style="margin: 0px 0px 0px 0px; width: 100%;
 background-color:#2f2f9d;">
  <img src="/icons/repository_title.gif" alt="Dr Bobs Repository"
   width="344" height="61"/>
</div>

so that I get a nice looking header that renders a lot faster than the old TABLE HTML.

In the end, it's been about 30 mins all-told, and we are up to the latest Git at 1.6.4. Not bad at all.

Updated my WordPress Passwording to Using Members Only

Monday, August 10th, 2009

wordpress.gif

Today I was looking at the fact that my old WordPress passwording scheme was not looking the way it should - clearly from lack of updates and support, and so I went on a search for a better plug-in for password protecting my blog. What I found was Members Only which is a nice plug-in that requires that users have accounts on the blog to read postings, and presents them with the login box if they go to the URL for a posting. Once the authentication is done, it's back to the requested page for a minimum of fuss. It's nice in that it's tied into the regular WordPress accounts. The old one had a single password and to give that to everyone wasn't really a good plan. Better now that I can have accounts and allow them to maintain the passwords, etc.

It's going to make it a lot easier to maintain the blog while allowing those people I know to be able to read the posts without exposing myself to any unnecessary legal exposure. It seems like a very nice balance.

Mercurial versus Git – For Now, I’ll Stick with Git

Friday, August 7th, 2009

Mercurial.gif

I was doing a little reading this morning and I came across another developer that was talking about how nice Mercurial was. He was mentioning a nice book he'd read on the subject and how much he liked the book. So I decided to take a little time this morning and give it a quick once over. Compare what I knew of Git to Mercurial and see how they stack up for my needs.

First, it's clear that each has a strong following. The linux kernel is in Git, and Google has adopted Mercurial. Both are strong statements to be considered. Certainly, if you're going to work on a project and it's in Subversion, or Git or Mercurial, then you have to do as the Romans do. But if you have a choice, and specifically, if I have a choice, what would I pick?

So what do I need? Well, I work on a laptop a lot of the time. Frankly, most of the time. I want something that's going to be significantly better than CVS - and I know CVS pretty darn well. Thankfully, both Git and Mercurial are winners here. There are Mac OS X GUI clients, and command line clients as well. Check.

Xcode support is important, but with the changes in Xcode to use ASCII files as opposed to binary files for nibs, I don't have to worry too much about this. Also, they have removed the 'bundle' concept for most things in Xcode, so I don't have to worry about directories appearing and disappearing on me. To be fair, Apple did all this work on it's own. That the SCM of choice doesn't have to worry about it is nice, but not leaning one way or the other.

I'll grant you that Mercurial is more like CVS, in that it's file-based and simple to understand. There's even a built-in web server to make it easy to act as a server for remote users to 'pull' a repository. Not bad. But Git has Gitosis, and now that I have it running, it's a server that I don't have to think about. It just runs. Period.

I could try to get Mercurial up on my Mac at home where I have CVS and Gitosis, but then I need to get Python 2.5 on that box, and it's an old Mac - suitable for the serving of these files, but it's not got the up to date Python that Leopard has. So that would be a pain. Not impossible, but a pain.

I guess it comes down to inertia.

I have Git, I have GitX, and they work. I have CVS for the old stuff, and it's never going away. Never. In the end, I might do some Mercurial work, but I'm guessing that it's even money that I'll stick with Git. It's just as nice and I have it all set up.

One Big “Woo Hoo” to Adium – Inspirational Software

Wednesday, August 5th, 2009

Adium.jpg

I communicate on IM all the time. I use it to keep in touch with my friends, help co-workers, and in general, it's the "one line email" that I simply can't imagine functioning without. It's what keeps me in touch with people I want/need to be in touch with. And on the Mac, there's one IM client that had such an incredible user-experience, that I feel I have to say something special about it.

Adium is one of the very best examples of software "done right" that I can think of. It "just works". It gets out of the way so easily that you wonder if it's really doing anything. It's quiet and unobtrusive when it's idle, and when it's necessary - it's as in-your-face as you want it to be. It's clean code. It doesn't crash. It just works.

It's a toaster.

To me, that's one of the greatest compliments you can pay to a piece of software. No need to wonder how to use it - it's obvious. No need to worry about breaking it - it's sturdy. It's a toaster.

Yet some of the neatest things are in the details. For example, it could do a lot less than it does and still be wonderful. But it allows you to really control your IM experience - groups, aliases, all work seamlessly and beautifully. It allows you to make the IM experience what you want - not what the developer wanted for you. It's really quite amazing.

Certainly, there are probably thousands of man-hours in this code, and it's been beaten on and tested to the limits. But still... it's Open Source. That's saying a lot. When a piece of free software is the best of it's class, it's more than just impressive... it's almost... magical.

It makes you think all programs can do this - be this. And for me at least, it makes me want to make my code this good. It's inspirational.

Upgraded to WordPress 2.8.3 at HostMonster

Tuesday, August 4th, 2009

wordpress.gif

This morning I noticed that there were additional bugs found in the WordPress 2.8.2 security upgrade, so out comes 2.8.3. The release notes from the WordPress Blog are simple:

Unfortunately, I missed some places when fixing the privilege escalation issues for 2.8.1. Luckily, the entire WordPress community has our backs. Several folks in the community dug deeper and discovered areas that were overlooked. With their help, the remaining issues are fixed in 2.8.3. Since this is a security release, upgrading is highly recommended. Download 2.8.3, or upgrade automatically from your admin.

Given that upgrading is so simple at HostMonster with SimpleScripts, it's a no-brainer. If there's a security update, I want to get it. I've got a lot stored in this guy, and keeping it safe is a key concern for me.

Firefox 3.5.2 is Out

Tuesday, August 4th, 2009

Firefox3.5.jpg

Once again the Firefox team has shipped a "stability and security" update 3.5.2 to patch some holes in the browser. Being a popular browser that's now been downloaded 1,000,000,000 times (lifetime), makes one a tempting target for hackers, and that's the reason for the updates. No big deal, the restart is handled well.

Colloquy 2.2.2 is Out

Monday, August 3rd, 2009

Colloquy.jpg

This morning I saw that Colloquy 2.2.2 was released with a required update that you get to Tiger (which is still pretty old) to use. I'm betting there are a lot of little bug fixes - probably a few crashing bug fixes, as the app is pretty darn stable as-is. If you want to have an IRC client, this is the best I've ever seen on the Mac.