Tuesday, June 03, 2008

upgrade JBoss Tools from 2.0.1 to 2.1.0

Since JBoss Tools is a drop in plugin, you just copy the files into eclipse/plugin folder to install, I wasn't able to figure out how to remove the old version. It may not matter to eclipse but it just doesn't feel right to have multiple versions hang around. I know you can switch back and forth among different versions. But how often do you switch back? Plus eclipse is not able to recognize 2.1.0 of JBoss Tools anyways.

After fiddling with eclipse plugin management UI for a bit, I lost my patient and went with the brutal force:


cd eclipse/plugin
ls -d org.jboss.tools.* | grep 2.0.1.GA | xargs rm -rf
So far so good. Everything is still working.

Please comment if you have a better way to upgrade JBoss Tools.

Thursday, May 29, 2008

screen resolution for k/ubuntu 8.0.4 hardy heron running on virtualbox

Just fixed a resolution issue for my ubuntu hardy heron guest system running in virtual box (host is kubuntu 8.0.4). The solution is based on this thread.

There are two things I changed in xorg.conf to make it work:

  1. find the video driver device second and add Driver "vboxvideo". see following:
    Section "Device"
    Identifier "Configured Video Device"
    Driver "vboxvideo"
    EndSection

  2. find the screen section and add a display subsection including the modes.
    Section "Screen"
    Identifier "Default Screen"
    Monitor "Configured Monitor"
    Device "Configured Video Device"
    SubSection "Display"
    Modes "1280x800" "1024x768" "800x600"
    EndSubSection
    EndSection
Voila! it works. The only drawback is that the auto-resize guest display function of virtual box doesn't work.

starting vmware server on ubuntu 8.0.4 hardy heron

It wasn't an easy task to get vmware server installed on my kubuntu 8.0.4 box with kernel 2.6.24-17. And after jumping through all those hoops and firing up vmware, I cannot start any virtual machined created. The message I am getting is: Unable to change virtual machine power state: The process exited with an error: End of error message.

After a couple fruitless google searches, I saw a post mentioning about the debug information. Then I went to "edit virtual machine settings" -> "options" -> "advanced" and enabled the "run with debug infor" option. Hah, I got the actual error right away.

It turned out to be that I installed the vmware server with "sudo" and it created a ".vmware" folder in my home folder with root:root permission. Changing the permission fixed my issue.

Ehh.

Monday, March 31, 2008

join lines in Eclipse 3.3

Many times a day when formatting/re-factoring code I join the next line of code to the end of current line. If it is java code, you can do ctrl-delete twice then insert a white space in between two lines. If it is xhtml file, two ctrl-delete will remove the opening tag of next line (at least in JBoss Tools editor), so a lot of times I just type delete key as fast as I can, Yuk. I cannot tell how much I miss 'J' in vi to join lines.

NOW in Eclipse 3.3, a new (new to me) shortcut ctrl-alt-j will do exactly what 'J' does in vi, joining two lines and put a white space in between. Command-alt-j on mac.

Try it and you will like it.

Thursday, March 20, 2008

Using SEAM i18n support to externalize strings

SEAM brings support of i18n in JSF applications to a whole new level. It is another show case of "convention over configuration" design philosophy. But its documentation misled me a little bit.

By default, the resource bundle used by Seam is named messages and so you'll need to define your labels in files named messages.properties, messages_en.properties, messages_en_AU.properties, etc. These files usually belong in the WEB-INF/classes directory.
By reading this paragraph, I thought that when all you want is to externalize some labels/strings in your application, you can just throw a file named messages.properties then start referencing resources using messages built-in component. It didn't work like that.
I also tried to force loading the resource bundle using tag core:resource-loader in components.xml file. It didn't work either.
Finally it turned out that you got to put the locale string in your file name although you don't care about locale at all. In my case I just renamed my file as messages_en.properties and everything worked.
I guess it makes sense in a way that a resource bundle got be associated with a locale. But won't it be nice to dump everything without an explicit locale into the default?