Monday, April 30, 2007

Web messenger

I've been using web based messenger for quite a while.The reason of using web based messenger is because I keep switching machine,between my own laptop and my office desktop.Web based messenger helps me keep track of my chatting history.And to avoid someone will read my chatting history like what happened to my friend and I before.These kind of people do exist,they read you chatting history and try to find out whether you talking anything bad on him or not.Sometimes I am lazy to deal with this so I just use web based messenger. :)
  • can use different IM including MSN,Yahoo!,GTalk and etc at the same time
  • store chat history on the server
  • able to cross platform
  • no more annoying emoticons(This is the part I like the most)
  • Unable to send files(some web based messenger support this,but the one I am using now doesn't)
  • needs internet connection to view chat history

Monday, April 23, 2007

SCJP Exam by next week

Well,I will be taking my very first SCJP exam next Thursday(Hope its the only one =..=).Hows my preparation?Actually I already finished study the book,probably will do more revision by this weekend.Wish me luck guys.

Sunday, April 22, 2007

Fax facts

This is a story I heard from my cousin.There is a girl,still a college student,working in a local company for industrial training.So one day her manager asked her to fax a document to client.After half and hour,the manager received a call from client,"Please stop faxing us the document,your clerk had send us over 30 faxes of the same document.".The manager was surprised,then he asked the girl in and told her stop faxing the document as client had already received it.The girl then said,"Got meh?But the paper is still there."

If those who thinks that if you fax it,the paper will disappear,you probably should read the description below(from wikipedia).
Fax (short for facsimile, from Latin fac simile, "make similar", i.e. "make a copy") is a telecommunications technology used to transfer copies (facsimiles) of documents, especially using affordable devices operating over the telephone network. The word telefax, short for telefacsimile, for "make a copy at a distance", is also used as a synonym.


In a normal EJB jar file,we will need to include a ejb-jar.xml in the META-INF folder.For EJB3,we can use annotation to configure the bean instead of writing it in ejb-jar.xml.Information such as bean name,mapped name etc can be configured through annotation.For more information,please refer to EJB3 javadoc.However,can we use an empty descriptor,a ejb-jar.xml without any configuration in our jar file.According to what I know,the configuration in ejb-jar.xml will overwrite the configuration done using annotations.This give the user flexibilities to change the configuration whenever its necessary without changing the code.

Thursday, April 19, 2007

Journey to the Enterprise Edition

I've started using Java EE 5 for the past few days.The very first thing is to choose a Java EE container.I downloaded GlassFish and JBoss and start evaluating them.I started my experiment on GlassFish V2.I got my first hello-world ejb working on it,no problem. So I started to port my application which is using Hiernate to communicate with database.Now the problems arised,GF has pre-defined Oracle Toplink as the default persistence provider ,so if I want to use Hibernate,I need to specify the provider in my persistence.xml.Fine, I can live with just modifying one file and using my preferred persistence provider.Then I also need to change the xml declaration with the correct schema.Then I deployed again,error occured. I spent the next 4 hours to make it work including moving the necessary libraries to server library folder.And the strange thing is,although i already specified the persistence provider, but sometimes it still pointing back to Toplink.So i have to use the admin console to stop the application,then start the application again.Did I mention that you need to include log4j.jar in you EAR/lib in order to use it?Yes,you need to.

I was so fed up with GlassFish,but don't get me wrong,its not mature yet,that's all.So I switched to JBoss 4.05.Ok,i just put my EAR in,and it runs.Then i found some other strange problems,when connecting to database,such as

Caused by: java.lang.ClassCastException: org.hibernate.ejb.EntityManagerFactoryImpl cannot be cast to org.hibernate.ejb.EntityManagerFactoryImpl

Weird,rite?How come the class cannot be type casted to the same type of class?Probably no many people out there met this kind of strange problems.So,googling wouldn't really helps.After another 5 hours I found out that the problem is because my EAR file contains some libraries JBoss has.I remove those duplicated libraries in my EAR file,and it works.

I shall continue next post with some of the features provided by Java EE 5.

Monday, April 9, 2007


I'd dream of you again,finally i can remember your face,but when is this going to end?when will you stop haunting me?am i not doing good enough to forget you?am i not felt guilty enough for leaving you 7 years ago?let me go,pls...