Subversion: Obstruction and NetBeans

Using NetBeans, I ran into a problem with subversion, getting a mysterious obstruction error message. Here’s what’s going on, and how to fix it. Java developers using subversion need to know about this; it’ll save you from ripping your hair out.

Had an interesting case come up, as I’m using JBoss 4.0.4 GA with NetBeans 5.5 Beta 2, which effectively gives me a J2EE environment in which I can run my Enterprise JavaBeans, which happen to be using the EJB3 standard.

The problem that I ran into was when checking my source code into Subversion, as I was getting an obstruction error message during an SVN Commit. When asked to perform a Clean Up, that didn’t help rectify the problem.

Here’s what was going on, and how to fix it.

Subversion stores in the versioned directories a hidden directory of its own called .svn which is used to record the meta-data of what’s in that folder. Before you can check in anything to the repository, you must be up to date with it. Subversion doesn’t want you, or anyone else, to lose data, especially during an update.

Normally with development environments like VisualStudio, a set of directories is created (such as obj, bin, Debug, and Release); these are directories you may want to preserve the directory structure of in version control, but not the contents of those directories. In general, compiler auto-generated content or transient files don’t belong in version control, as these files are usually binary and often big, wasting space.

NetBeans creates a build and dist directories for Java projects. And, while it may seem safe to check these into subversion, it is not.

If you were to check in the build directory, even if you ignored the contents, subversion has to keep track of what’s going on and created its hidden .svn directory inside it.

However, when NetBeans does a Clean and Rebuild, instead of erasing the directory’s contents, it deletes the whole directory and recreates it. Anything inside that directory is lost forever, including the .svn directory.

Now when you go to do a Subversion Check In, it sees the directory exists, but it doesn’t see its .svn file. Subversion thinks you accidently deleted its directory and recreated another directory with new content in it by the same name! Hence, you’ve obscured it.

Clean Up is going to fail as well, as there’s no .svn directory to twiddle. You’re at a standstill until you correct the problem.

Doing so is easy.

  1. Get rid of the offending directory – delete it, move it, whatever.
  2. Perform a svn update to get yourself in sync with what’s in version control.
  3. Right click and do a SVN Delete… on the offending files and directories.
  4. Perform a commit, which saves the state that those do not belong in version control.
  5. Open your development environment and do a Clean / Build, recreating the problematic directories – not to worry, they are not in version control
  6. Perform another commit, however this time select all the files and directories that don’t belong and ignore them (right click, it’s in the pop-up); repeat until you have the smallest set of top level directories.
  7. Let the commit happen, recording the fact you do not want version those directories in the future.

At this point you should be good. Subversion won’t save them, and NetBeans will delete and recreate them without stomping on Subversion’s meta data.

Protecting Windows XP

While I no longer support Microsoft Windows, here is list of Walt’s recommended software to help keep your machine safe.

Just having this alone software won’t protect you, it must be used properly, and frequently, with liberal doses of common sense.

Spyware Blaster
This protects a running system from getting infected, grab updated and enable them frequently.

Spybot Search and Destroy
This finds all kinds of evil stuff in your system and removes it. Update frequently, imunize, and scan.

Ad-Aware SE
This looks for a lot of stuff as well, but different kind of things – works great with Spybot.

Anti-Virus Guard Free Edition
A very good virus protector — I use it over Norton and McAfee.

Registry Mechanic
Scrubs the registry for when things don’t uninstall correctly.

Peer Guardian 2
An active firewall for catching -outgoing- traffic!

FireFox
A richly featured, free replacement for the horrible and vunerable Internet Explorer. Be sure to snag the Update Notifier, AdBlock and Adblock Filterset.G Updater extensions.

Other tips —


  1. Turn your Windows firewall on.

    [ Start / Settings / Control Pannel / Windows Fire Wall / On ]

  2. Update your computer often, using custom (not express), so you get all the updates.

    [ Start / Windows Updates ]

  3. Make regular system restore points

    [Start / Help and Support / “Undo changes to your computer with System Restore” / Create a Restore Point ]

  4. Defragment your drives often.

    [Open My Computer, Right Click C:, Properties, Tools, Defragement Now… / Defragment ]


And, in all seriousness, consider moving away from Windows — look at OS X, Ubuntu, or Fedora Core. If you can get past “Oh no, it’s not Windows! I’m scared! It’s unfamiliar! I quit!” and just try it, you’ll see it’s not as complicated as you fear, and installation and use is actually easier than Windows.

    I’ve literally seen a 4 year old use OS X without instruction and use various apps.

    I’ve observed a 13 year old girl who wasn’t computer savvy install Linux and immediately start web browsing, drawing in Gimp, writing in OpenOffice, talk via Instant Messaging, and playing videos …all without being taught or trained.

iTunes install fails on XP… no worries

Installed iTunes on XP, but it blew up with an iDriver application error and didn’t finish the install. Turns out this is an easy one to fix.

Went to install the latest iTunes (with Quicktime) and got a nasty looking iDriver.exe -- Application Error message.

Opps, I’ve seen that before. It’s part of the install shield tool and not iTunes. Here’s what to do about it:

1) Disable your Anti-Virus system during the duration of the install.
2) Open Task Manager and kill all the processes starting with iDriver, iTunes, and iPod, including the helpers.
3) Re-run the iTunesSetup.exe program again.

If you get an error message at this point, go to this page on Trouble installing iPod, iTunes, or QuickTime software in Windows.

Unable to locate TOOLS.JAR

Got a message that Ant couldn’t locate tools.jar, and for a second it confused me. Turns out I had just upgraded Java and hadn’t updated the JAVA_HOME environment variable. In the process, found a nifty little guide about how to set up Ant for new users. Very well written.

Was playing with ant today and started getting a message saying it was unable to locate tools.jar, which normally sits in Java’s lib directory.

Silly me. I had changed java versions recently and needed to update my JAVA_HOME environment variable.

Here’s an excellent resource for setting up ant if you’ve never done so: http://www.j2x.ca/developer/other_docs/ant_beginner_tidy.php

CMD.EXE Command History Pop-Up

Hey, did you know F7 brings up a command history in CMD.EXE? It’s done that for years, and this was the first I’d ever run into it.

In Unix’s bash shell, for instance, there are some nice features for command line completion. If you type the word history you’ll get a list of the last commands you executed, preceeded by numbers. If you type ! immediately followed by that number, it will re-run that command. If you type ! prefixing the start of some command, it will hunt back through the history and run the first command started with said prefix.

Today while working the XP DOS Box, I bumped a function key and got a pop-up box of my command history. In all my years working with NT, 2000, and XP, I’d never seen that before. So, wanting to recreate it, I researched what it was and how to do it.

The program to thank is DOSKEY. Pressing F7 while at a command problem brings up the command history menu that surprised me. If you already know a command’s number, because you saw it in the list, F9 will let you just enter the number directly. If you type a letter and press F8, it will cycle through all commands starting with that letter.

Pressing ALT-F7 will clear the command history, which on Unix is the same as typing history -c.

Unix has a lot more options when it comes to the history and fc (fix command) than Windows, but it was nice to see a small subset implemented.

Just another small trick to add to the productivity bag.

Recovering Data from Windows Crash

XP couldn’t help us get data back from a crashed Windows box, but a OS X and BYTECC BT-200 did the trick — and the experience taught us that Xandros may be the right path to keep your old machines but not have to put up with Microsoft.

I was recently approached for assistance with getting an older machine that refused to boot Windows back online. I’ve made the point pretty strongly that I don’t do Windows anymore, in particular because system recovery from catastrophic events is tedious, time consuming, often incomplete, and provides no guarantee that it won’t happen again. And now, thanks to WGA, catastrophic events are even more frequent than when we just had viruses to contend with.

Most of my clients seem to believe there’s some magic wand or setting it takes to bring things back, and few are willing, or able, to provide compensation for the hours of work it takes, much less have the technical ability to keep things in a working state after I’ve left them — even with training. They lack disclipline nor see the need, figuring if it goes south, I’m on call. Well. I’m not.

The real hitch is when you’re dealing with kind old ladies or close relatives. While you want to help them, often you can’t. Support and licensing models have changed. Gone are the days of simply fixing a machine even if they have the disc on the table. MS doesn’t support the older operating systems like they do XP, clients often can’t afford what you recommend to them as the bare minimum needed, and even if they could, their computer can’t run the new stuff… and an expensive new computer is out of the question. Microsoft’s executive staff may be made of money, but students, elderly, young parents, and average American families are not. A machine is big investment, so is the OS, and they expect it to last for over a decade.

In this one case, however, we had the system restoration disks from the OEM vendor, but the problem there was that a restoration would wipe out the data on the drive. Not good.

Apple, bless their heart, allows you to archive your whole system, and install on the same drive as your data without losing it. No such luck here. This was Windows. Licensing, not technology, was getting in the way.

The solution, it turned out, was to simply move the data to another Windows XP box. The way we’d do that, since he couldn’t boot, would be to pop the IDE drive out and use a BYTECC BT-200 USB 2.0 TO IDE converter. Oh, you want one. I own two. This thing makes an internal IDE drive mountable as easily as a USB thumb drive.

And so we did. However, when we plugged his drive into a working XP box, we did not get the result I’d seen every time before. What we got was disk spinning, blinking lights, and a Windows box stating the drive could not be mounted.

We even tried another USB port. Same thing. XP could not read this drive, and the most likely suspicion was a hard drive failure.

But, on the off chance, I suggested we try something. We simply moved the USB connector from the XP box to the Mac OS X box. Within a second the drive mounted perfectly. What was this? XP couldn’t read a Microsoft formatted drive, but OS X could? Yes, OS X saved the day. Again.

We proceeded to copy everything off the drive onto the Mac without incident. Just for fun we put it back on XP. Same deal, XP couldn’t mount it. And, this was a fully patched high end XP system.

Meanwhile, back on the Mac we reorganized the files, ran a few shell scripts to automated the sorting and pruning process, and when done burned three cross-platform DVDs.

Please don’t quote me for saying this, but it was the first time ever that data recovery was actually… dare I say, …fun. I don’t mean like, “oh it worked and we didn’t lose a thing”, as I’ve done that zillions of times before, but no, I mean like enjoyable play kinda fun.

The next thought was to put the drive back in the old box and reformat it with the OEM disk, and bring the data back. However, I was stopped in my tracks. It seemed a trip to the Apple store was suddenly in our future. For, if data recovery was the easy and enjoyable, imagine what working in an environment like that would be.

As for the old box? I suspect very soon wit will be running a copy of Xandros, a Linux distribution that is designed for Windows users to run Windows programs.

Review: Picasa Web Albums

If you’re a digital photographer, then you know the hardest part of the workflow is getting your images to a webpage because of all the work that has to go on dealing with adjusting, labeling, resizing, and moving the images. Google’s Picasa Web Albums comes to the rescue, and it can handle a lot of photos well.

Take a quick gander at my web gallery. To be honest, I don’t know what you’ll find up there at any given moment. The reason? I’m having too much fun playing with it!

The album is hosted by Picasa Web Albums, and I already know what you’re thinking: you use Flicker or PhotoBucket. Well this is different.

Much different.

Goggle’s free Picasa, software will scan your system for photos. You can browse them super fast, present slide shows, crop, strighten, fix red eye, correct color, correct contrast, correct brightness, and apply a ton of effects. You can email, print, order prints, make collages, export, and blog. But you can now automatically upload as a Picasa Web Album. And it’s fast.


    Hint: make sure you go to Tools / Options.., select File Types, and turn on all the file types, like GIF and PNG, in order to get everything on your system.

OS X users aren’t left out at all, given that Apple’s iPhoto, does the above as well, Google gives you a plug-in that makes iPhoto export to a web album. They also give you an uploader, in the event you just have a folder with pictures.

The web album does all the rest, however — thumbnail browsing, photo selections, order organizing, downloading, publishing, printing, and notifications. Yes, you even get RSS feeds, so people subscribing to your photo album will know when you’ve updated without you having to send an email.

It’s interactive. It’s awesome.

This is a great tool for any digital photographer who wants to go from camera shoot to web pages in a very short period of time.

Walt gives Google Picasa Web Albums a thumbs up!

Do a Project Health Assessment

Try this simply one-page quiz to score your current software project. Is it rockin’ or is it in a death spiral so bad you’ll never pull out?

A while back Software Development magazine had a fun little article about a number of things that could go wrong with a project. At the time, I was in a project that was in a horrific death spiral, so for fun I made up a small quiz to rate a project. It took a smidge bit of tuning the scoring, but it works adaquately enough to get the point across.

Project Health Assessment

It works surprisingly well. I suggest trying it three times. Once for your current project, then once for the best project you can remember working on, and once for the worst project you can ever remember. The last two will help validate to you that the your current project evaluation is actually quite accurate. Then pass it out to your co-workers, and see if you all have the same unspoken assessment.

1 page PDF of about 60k


I’d love feedback to see what your scores were and how accurate you felt it was, along with any suggestions to improve the quiz.

Problems Downloading Aqua Data Studio

Small problem when downloading .EXE files from legit sites, packages like Norton Internet Securty will thwart your attempt, mangling the HTML code itself, so that you don’t even have a link to the software you want. Here’s the hack workaround.

While trying to download a copy of Aqua Data Studio for personal use, I noticed there were no links on the page to get the product.

For a moment, it confused me. Then I realized the problem resides in Norton Internet Security 2005 AntiSpyware Edition. This little package which is supposed to protect you from evil things on the Internet actually alters web page content, adding its own JavaScript besides.

The reason for it is honorable, but the effect isn’t benign. It strips out the links to the “.exe” files which it feel you might accidently click on, download, and automatically run — a setting many novices have selected and get themselves into a heap of virus troubles.

The solution is to right click the Internet Security icon in the bottom right (it looks like a yellow globe grid), choose Disable Norton Internet Security, and specify a time like 5 minutes.

Well, I did this, and when I went to reload the page, much to my surprise it didn’t fix the problem. Then it dawned on me: browser cache. A shift-click on the refresh button, and the links I needed magically appeared.