JAXB sucks

Allow me to enumerate the many ways I hate JAXB. JAXB is an XML data binding tool for Java; that is, it generates code to make using XML more Java-like. This is great in concept. In reality it is not so great:

  • Two days away from your project due date, JAXB lets you know that it isn’t mindful of the method size limits in the JVM. Javac tells you: “code too large.”
  • There’s a limit to method sizes in the JVM?
  • Upon examining a generated class, you discover 25k lines of utter garbage. Things like the same if-then clause being repeated twice in a row.
  • Turning off generation of the validator, or the unmarshaller, or the validating unmarshaller does have the effect of reducing code size, at a cost of generating code that doesn’t compile.
  • Or if it compiles, it throws a runtime exception when you use it.
  • The object hierarchy is all screwed up, such that a concrete implementation type may implement a (JAXB internal) interface that is not also implemented by the corresponding abstract interface (the two are supposed to be interchangeable).
  • You have to do naughty proprietary things to make type substitution work.
  • Creates a new namespace prefix for practically every element even though I only use 3 namespaces in the entire document.

I only just learned about XMLBeans. Dammit.

Geekery

What do you do when your college plays at 2pm and you are stuck at work with no TV around? You write a CGI to grab screenshots from your TV so you can watch it on a webpage, of course.

#! /bin/sh
echo Content-type: image/jpeg
echo

mplayer -frames 1 -vo jpeg -nosound /dev/video >/dev/null 2>&1
cat 00000001.jpg

Opaque

The only thing worse than reading XML is reading W3C XML documentation: The xsl:namespace-alias element declares that the namespace URI bound to the prefix specified by the stylesheet-prefix attribute is an alias for the namespace URI bound to the prefix specified by the result-prefix attribute.

Ah, glad they cleared that up.

My new project

What do you do when you have 300 CDs ripped and encoded on your living room PC, an affinity for perl, and two hours of commute time on the bus every day? What else — you make a remote-controlled kiosk style jukebox. Here’s a peek at the TV interface:

404

Well my website is down again so you don’t get to see the artifact I discovered until it comes back up. Maybe it is time to start paying for a hosting provider.