Sunday, June 5, 2011

Linux - not for the faint hearted

I am currently deploying a WebObjects application on an Ubuntu server. Yes, yes, I am very brave. But I have help, so it has not been that difficult.

What has been problematic is something that we take for granted - fonts.

Yes, Ubuntu and many flavors of Linux have no fonts installed. Yes, you read that right. No fonts. Period.

But little Kamal did not realize that and he set upon a mission. Of generating reports on a WebObjects application on Ubuntu using ReportMill.

App was deployed. First there was some issue with the WebServerResources. None of them were being read. I figured out that WO WebServerResources are stored in some other folder - not the regular document root of Apache on Ubuntu. Then I got the app working with the WebServerResources.

Then I tested the app and got an exception when I tried to generate the report. The exception was something about a font class not being found:

Could not initialize class com.reportmill.text.RMFont:java.lang.NoClassDefFoundError: Could not initialize class com.reportmill.text.RMFont

At first I thought that the ReportMill jar is not being found. Trust java to come up with some weird exceptions! Class not being found it said. Wait till you hear about what the reason for the exception was!

I contacted Shravan Kumar Mahankali, the best WO guy in India. The genius that he is, he immediately pointed out that the problem was not with the jar since the Font class was being recognized (otherwise we would have got a much higher level class not being found).

A little googling told us that in Ubuntu no fonts were installed by default. And we would have to install the basic fonts too. Some more googling and a lot of trials and errors later, I found that the command:

sudo apt-get install msttcorefonts

solved the problem!

I really wonder why even the basic fonts are not installed in this platform! Heck, I used good old Arial! Event that wasn't present. Despite all the changes, Linux continues to be a geek's OS. Not for the rest of us. 

4 comments:

Shravan Kumar. M said...

Congrats Kamal. You are brave hearted :)

Akbar Pasha said...

I think given the scenario of Java's Oraclization - WebObjects should switch gears and move back to Objective-C-2.0. That way they would say we don't support Linux and you will *never* have to go through this!

:-).

Java is for suckers!

Kamal D Shah said...

Well, well, that is a pretty strong statement!

Java does have its shortcomings - I cannot stand the gazillion configuration files you need for Enterprise Java - but it has a lot of fans. I know that the number of fans does not mean it is great. But there must be something about it that makes it so popular.

What are your thoughts about RoR?

Akbar Pasha said...

Oh I don't want to start a troll war - but I think RoR sucks in it's own way too - too much magic.

Agreed that Java has very strong hold in Enterprise systems and there are some cool apps written in it. But admit it, it's bulky and slow. The whole extend a class to write your own program is over used.

I think I have moved on with having favorites wrt to programming languages and frameworks - which is a relief. :-)