A Golden Gem

JavaPro Magazine has done a review of my book, Ant Developer’s Handbook!!! The first line is the best:

The Ant Developer’s Handbook is one of those golden gems that appear every once in a while.

That is music to my ears. Now go read the whole review and then go buy your very own copy!

No (Apparent) Love Lost In JBoss Group Split

After this morning’s surprise announcement that JBoss Group was essentially forking, there has been a lot of speculation about what this means for JBoss Group specifically and JBoss in general. The new company was started by 8 now-former JBoss Group consultants and was announced with much fanfare this morning. Ben Sabrin of JBoss Group just posted a “rebuttal” of sorts to the jboss-user mailing list. He took a few jabs at the departing consultants and made one statement that’s a bit hard to swallow. The jabs:

“…the most important developers are on board with JBoss Group.”

“WE have the financial resources to patch the departures of three consultants in our US consulting operation.”

and the dinger is

“It is business as usual and JBoss Group is currently growing.”

The statement that all the “important” developers are on board is an attempt to downplay the reputations of those who have left by implying that they were second string, while the second is attempting to indicate that the new company is going to be strapped for cash, probably to scare off potential customers. I have no personal info on either statement or situation, nor do I know if the developers in question are useful or not. From what I can tell, though, in reading the various articles about the split, the consultants who left all seem like integral parts of the team… I can’t blame JBoss Group for being ticked off, but these statements just strike me as a little smarmy.

The dinger is a dinger because how can you be growing if half of your consultants just left?

I think it will be interesting to see how all this plays out over the next several months. Will this lessen or increase the business use of JBoss? I actually think the potential is there to increase it because you have more options for support, but that’s just me.

Jython Is Just Too Useful

A colleague just came to me asking about Java serialization and output options. We’re going to store some partially filled Serializable DTOs in a BLOB in our database so he needed some info. Our talk then turned to options for storage and such. He already knew about using ObjectOutputStream on top of a FileOutputStream, but I also told him how to get a byte array from the object using a ByteArrayOutputStream. To illustrate, I fired up Jython in interactive mode and typed the following:

[c:tmp] jython
*sys-package-mgr*: processing modified jar, 'C:AspectJ1.1libaspectjrt.jar'
Jython 2.1 on java1.3.1_02 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from java.io import *
>>> from java.util import*
>>> m = ArrayList()
>>> m.add("Foo")
1
>>> m.add("Bar")
1
>>> m
[Foo, Bar]
>>> baos = ByteArrayOutputStream()
>>> oos = ObjectOutputStream(baos)
>>> oos.writeObject(m)
>>> oos.close()
>>> dir(baos.class)
['__init__', 'reset', 'size', 'toByteArray', 'toString', 'write', 'writeTo']
>>> baos.toByteArray()
array([-84, -19, 0, 5, 115, 114, 0, 19, 106, 97,
  118, 97, 46, 117, 116, 105, 108, 46, 65, 114, 114,
  97, 121, 76, 105, 115, 116, 120, -127, -46, 29,
  -103, -57, 97, -99, 3, 0, 1, 73, 0, 4, 115, 105,
  122, 101, 120, 112, 0, 0, 0, 2, 119, 4, 0, 0, 0,
  10, 116, 0, 3, 70, 111, 111, 116, 0, 3, 66, 97,
  114, 120], byte)
>>> bais = ByteArrayInputStream(baos.toByteArray())
>>> ois = ObjectInputStream(bais)
>>> x = ois.readObject()
>>> x
[Foo, Bar]
>>> m
[Foo, Bar]

There are lots of cool things there, but specifically, notice the bits in red. I couldn’t remember the method to call to get the byte array, so by using the Python dir() method on the class of the object, I got a list of available methods. toByteArray() was the ticket and you can see both the array itself and then that I went further and deserialized the byte array using a ByteArrayInputStream. Think about how many lines of Java code I would have had to write to show him the same thing. But even if the syntax were just as verbose as Java, not having an edit-compile-run cycle made the demo far faster and productive than it would have otherwise been.

Tracking Down a Log4J Problem

I had a really interesting time tracking down a Log4J problem. We’ve been using Log4J for over a year now happily and even happier with the Commons Logging package on top of it. But last week (while I was on vacation) something went pear shaped: the logs got created but after some initial log messages got sent to the logs, no further messages would get logged. I checked the config file (the XML variety, not the properties file) and it was correct. I then set about digging through code to see if someone had programatically changed the logger, but found nothing. Finally today I found the culprit: a rogue log4j.properties file in a war file in our ear file (that had been there the whole time) had been changed to set the root logger to a level of WARN. Since all of our log messages are at INFO level, thus they never made it. I’ve tested this and it is indeed the problem.

That was a real pain to diagnose, especially since the offending file had not been checked into our source repository. Had it been checked in, I probably would have spotted the change sooner.

My One Complaint About The Latest Eclipse

I have but one complaint about the latest release of my favorite IDE, Eclipse. Everyone who uses Eclipse knows that to close an editor you click on the little ‘X’ button on the right side of the editor’s tab. But for the past several months there’s been another way: Control-Click anywhere on the tab. (You can also Ctrl-F4.) The Ctrl-Click struck me as odd when I first read about it, but I’ve come to do it reflexively. Now they’ve taken it away!!! I don’t know why, but they did. And I’m not happy about it… I keep Ctrl-clicking on those tabs and they just don’t go anywhere now…

Latest Nightly Eclipse Re-Adds Editor Linkage

The latest build of Eclipse has re-added a feature that I had been missing since the M4 or so. This feature is a linking of location between the Package view and the current editor. You’ve always been able to double-click on a class in the package explorer and have it bring that class up in the editor. What you used to be able to do, and what you can do again, is to have the package view updated based on your location. So if I’m editing Foo and then I click on the tab for Bar, the package view will now show that I’m in Bar. This is now a toggle instead of being foisted upon those who don’t like it. If you install this latest version (remember to do it like this) you’ll now see a little icon on the top of the package explorer that looks like this

Toggle Switch

I’m really glad this is back because I missed it. But I’m also glad that there’s a toggle switch because there were times that this behavior was a real pain.

Eclipse M5 Painless Upgrade

Man, I love Eclipse more and more every day. I’ve been using it for almost a year and it just keeps getting better. The fabulous Eclipse team released Eclipse 2.1 M5 a couple of hours ago and I fetched it shortly thereafter. Wanna know how the install went?

  1. I shut down the instance I had running
  2. Squirreled away trusty M4 version for safe-keeping
  3. Unzipped the M5 distro
  4. Copied my workspace folder from M4 to M5
  5. Copied my plugins over from M4
  6. Fired up the new version

Why can’t all installs be that easy?

If you are an Eclipse user, think about getting this version. There are quite a few tasty new features lurking about in there.

What I Don’t Like About the Java Plugin

Why can’t the Java Plugin on Windows unload itself after you leave a page with a (stupid) applet on it, or after X amount of inactivity? I generally despise applets, but sometimes I have to use them, such as the one on the WebLogic console. What I really hate is pages that have an applet just for ad rotation. I have no problem with sites having ads, but loading up the Java VM (no small amount of RAM there) just to rotate ads bothers me.

But anyway, if they won’t do an auto-unload feature, at least give me the option of killing it via the Windows systray? (I am pretty sure that on Linux systems the plugin doesn’t hang around, but I could be wrong.)

How hard is that?

It’s Dead, Jim

I’m working with some Java wrappers for some CICS programs on our mainframe. I’ve been having a devil of a time getting the thing to work properly. In typical mainframe fashion, when it fails you get an ABEND and then some less-than-useful messages. Dig the one that I just got:

ECI_ERR_CICS_DIED

At least it was honest…