Glassfish v2 Create Domain – Keytool Error:java.io.EOFException

Yesterday night, I had to work on some interesting stuff with my application’s deployment tool. We have a Ruby RakeFile to automatically create glassfish domain and deploy apps. As I was running the tool creating domains atleast 10 times or so, suddenly at one stage I got an error while creating glassfish domain…the error was “keytool error: java.io.EOFException”. I thought some evil spirits has got into my laptop at the wee hours…hence gave up and went off to sleep.

Today morning, I thought let me give this a fresh look…
And I learnt that you can turn on debug logging by adding -DDebug in the asadmin script. This helped me to say that there is something wrong with a keystore that Glassfish was looking for while creating the domain.

After couple of rounds of googling, I realized that the keystore is stored in my home folder with the name .asadmintruststore. Apparently the file size was just 1 byte. I just deleted the file and now the creation of domain went thru fine 🙂

On thinking what could have corrupted the keystore, I realized once when the creation of domain was going thru, I had abruptly killed the operation by Ctrl+C, which could possibly have corrupted the keystore!

Hope this helps someone who bumps on this issue 🙂

Moral of the story : Dont try to stay late and work…sleep early 🙂

Ubuntu : On Hibernate , machine restarts

Uff! I have been trying to get Hibernate (Suspend-to-disk) option work properly with Ubuntu in my home PC, versions after versions, starting from Dapper Drake (v6.04) to the recent Karmic Koala(v9.10).

Even though the actual hibernation(meaning, dumping the memory content into the Swap partition of my disk) happens fine, my machine suddenly restarts within 3 seconds after a complete halt. I have been going crazy to even figure out the sentence to help google find what I am looking for from the net.

Finally, at 9:45pm with half sleepy eyes, I managed to find some help after going thru lines and lines of posts from various forums…that I had to add a file to my /etc/pm/conf.d and add the following line to the file

HIBERNATE_MODE=shutdown

the hibernation happens properly and my machine goes to sleep happily thereafter 🙂
Thanks to this post
PS: Folks, also please ensure that you specify where your hibernate file is present to Grub to ensure it wakes up instead of booting afresh. You have to add resume=/dev/sda5(swap partition). But I also noticed recently in my dad’s netbook, without this resume option, GRUB properly wakes up from Hibernation. God knows how!…Something to research on sometime later….Will post my findings if any 🙂