Mar 24

J2SE 6 has some interesting new XML functionality called JAXB. Using JAXB, you can take an XSD file and compile it into Java classes. You can then add those classes to your project, create an Unmarshaler object, feed it some XML which meets the XSD, and it will pass you back a tree of appropriate POJOs you can mess with.The only problem is that the XML file my source application generates refers to a DTD which JAXB tries to load via xerxes, causing epic fail.

Clearly I could rewrite the XML on the fly, perhaps even using XSLT to make the code even more enterprisey. However, I can’t help thinking that there should be a simpler way to either make xerxes/JAXB ignore the DTD (which, after all, it doesn’t need), or tell it how to find it.

Anyone happen to know?

[And yes, this is horribly enterprisey, but the benefit of being able to unmarshal a large population of XML-represented objects in only 20 lines of code is too good to pass up. Plus, I already know that the bottleneck in the intended application will be database speed.]

Nov 01

(It was obvious.)

Continue reading »

Oct 05

Google quietly overhauled Google Reader recently. It’s now worth checking out, it has a more Gmail-like interface and can be used to chew through a few hundred web feeds.

If you’re still using an archaic feed reader (e.g. the TrollJournal “friends” page) you should definitely check it out and see what you’re missing.

I like that it has a phone-optimized interface available, so I have the option of checking my favorite web feeds from anywhere.

May 20

Fedora Core 1 died, so I installed the latest rev of the corporate desktop based on something else… which means I’m stuck with GNOME, as there aren’t any working KDE installs I can find.

With KDE it was really easy to install fonts. Almost Mac-like, in fact. Open the fonts window in Konqueror, drag the TrueType and Type 1 font files in, drop. Done.

In GNOME, I open my directory of fonts. The file manager previews them for me. I can double-click them to see them previewed larger. However, the preview doesn’t have any kind of install button, nor does the contextual menu for the files have an install option.

GNOME doesn’t seem to have any kind of font installer either. The “Font” control panel lets you select rendering options and which fonts to use for the UI, but it doesn’t actually tell you how to install fonts. The system Control Center doesn’t include anything for installing fonts either, though it does helpfully include an icon to open itself from within itself. Aaargh.

The GNOME help is useless too. It has four entries for “font”. One is about how to import fonts into Ghostscript, two are about importing and exporting TeTeX fonts, and the fourth one suggests that the way to install fonts is to edit /etc/fonts/fonts.conf

So I tried that, and discovered that the file had a comment saying no, don’t edit /etc/fonts/fonts.conf, instead edit /etc/fonts/local.conf. So I tried that, only to find that it was a mostly empty raw XML file. In particular, it didn’t mention any of the additional fonts the system already had installed, so it was clearly the wrong place.

So I tried Google and searched for an FAQ on how to install fonts in GNOME. First up was the GNOME end-user documentation on fonts. It talks about “subpixel decimation” and “GASP tables” and how to access someone’s CVS server to download a font viewer, but totally fails to mention how to install a font. At the very bottom of the page it finally mentions that GNOME’s font selection is handled by something called fontconfig.

So, off I go to the fontconfig site, and to what they laughably call their user documentation. Hey, look, it’s that fonts.conf man page again.

OK, back to Google. I find a reference to gnome-font-install. Sensible name, but (a) it turns out to be something specific to printing, and not actually a font installer; and (b) it isn’t on my system according to locate.

Time for a different approach. I search for how to install fonts for xfs (the X font server) instead, and find out that there’s a tool called chkfontpath, which actually installs fonts in the font path rather than only doing what its name suggests. So, I pull up the man page. Looks good. % chkfontpath -a /opt/coolfonts.

chkfontpath: error opening /opt/coolfonts/fonts.dir, unwilling to add path

Back to the man page. Yes, chkfontpath needs some sort of special fonts.dir file, says right there at the bottom, before completely failing to mention what the file should contain. Is there a man page for fonts.dir? No. Is the file fonts.dir even mentioned in the xfs man page? Is it fuck.

Finally I find a web page that explains the hoops you have to jump through to install fonts in GNOME. First you have to use ttmkfdir to prepare the directory containing your fonts. Obviously I didn’t find this in my searches, because it has no fucking manual page.

Having done that, you can then run mkfontdir to generate the mysterious undocumented fonts.dir file. Obviously I didn’t find that either, because it doesn’t show up on man -k fonts.dir. Yes, I know, it’s unreasonable of me to expect that a program whose sole purpose is to generate a file fonts.dir should actually mention fonts.dir in its man page index.

Having done that, it was indeed trivial to go back and run chkfontpath and actually install the fonts.

I now understand that when people say Linux isn’t ready for the desktop, it’s because they run GNOME.

It’s not just the lack of a friendly installer that makes me angry; it’s the fact that at every step of the way, the documentation is utterly useless at describing how to do the most basic task a user needs to do, yet describes itself as user documentation.

Mar 05

21:32:26,041 ERROR [Server] start failed
org.jboss.deployment.DeploymentException: Could not create deployment: file:/opt/jboss-3.0.6_tomcat-4.1.18/server/default/conf/jboss-service.xml; - nested throwable: (java.lang.AbstractMethodError: org/jboss/deployment/scanner/AbstractDeploymentScanner.scan) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:835)
[…etc etc…]

Stock JBoss/tomcat downloaded 10 minutes ago, stock RedHat 8, Java 1.4.0.

You know, J2EE really sucks dog balls. Every J2EE environment I’ve tried to get working has had some massive brokenness about it. Does anyone have any suggestions?