Tuesday, October 2, 2007

No more comment,thank you

Sometimes ppl will ask me to listen to their stories and then ask for my opinion.I always give suggestions which I think are the most suitable,but not anymore.They can actually decide themselves, so why ask for my opinions?If I spent weeks to think a solution for them,and in the end nothing is taken,I felt like I am wasting my time.I don't know about others,but my time is somehow precious.I respect other ppl final decision,and i always think they know what are the thing they want,and this is what I want,no more comment,thank you.

Wake me up when September ends

Last month seemed like the busiest month I ever had.Almost every weekday I reached office at 5 or 6 am,and work all the way to 7pm,just to prove that I am not a bum to my manager.He assigned me tons of works at the beginning of September,and requested me to finish them within 3 weeks.Some of the functions are half done by other colleagues,and I am the one who clean up the mess.However,I did prove my value and my abilities by finishing almost everything on hand.I can't really finish all the things due to some requirement changes and I need more time to apply the new changes.
So,in your face,Mr Manager...

Tuesday, July 31, 2007

What's the problem,mate?


Sometimes you might feel a bit down,problems around you just can't stop haunting you.Don't lose yourself into it,instead you should face it and solve it.Letting the problem lying there doesn't mean it will go away after a while.You might even need to spend more efforts if you don't solve it asap.So,all the best,mate...

Wednesday, July 25, 2007

Evolution


I've been using IMISSCSY as my nickname for few years.Never think of changing it until yesterday.I had a long chat with my friend in JB,who just got married early this month.And he told me that the other friend also got married early this year and expecting for his first child end of this month.Suddenly I felt the people around me changed,and they changed alot.We used to be together and talking craps.But now all of them have their own family,what about me?I felt like I didnt improve at all,did I ever think about future?What about family?What about my dream?Its like I threw these things away long time ago.

I think maybe this is the right time for me to evolve.I've decided to achieve something,and become somebody.I shall no longer be haunted by my past,and no fear to the challenges I am going to face.

Wednesday, June 27, 2007

JDK 1.6 + JBoss 4.2.0 + EJB3 Web Service + Axis2

Few days ago I started to implement web service in current project.I exposed a few methods in existing EJB.The deployment of WS to JBoss server and generating WS client using Axis2 are ok.But when the client trying to invoke the WS at server,exception was thrown at server side.

java.lang.UnsupportedOperationException: setProperty must be overridden by all subclasses of SOAPMessage
at javax.xml.soap.SOAPMessage.setProperty(SOAPMessage.java:424)
at org.jboss.ws.soap.SOAPMessageImpl.(SOAPMessageImpl.java:65)
at org.jboss.ws.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:115)
at org.jboss.ws.binding.soap.SOAP11BindingProvider.createMessage(SOAP11BindingProvider.java:59)
at org.jboss.ws.binding.soap.SOAPBindingProvider.bindRequestMessage(SOAPBindingProvider.java:89)
at org.jboss.ws.binding.soap.SOAP11BindingProvider.bindRequestMessage(SOAP11BindingProvider.java:65)
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:645)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
...

Same problem was reported at JBossWS Jira .click here

After I googling,I found that this problem only arise when we use JDK 6. I tried to switch back to JDK5,and it works. Then I tried various methods, such as trying to deploy on JBoss 5.0 beta yet it still doesn't work. According to some forumers, the reason for this is the SAAJ classes being used in Sun JDK 1.6.0 are not compatible with JBossWS since they use their own SAAJ jar named jboss-saaj.jar. So,we will need to make sure that jboss-saaj is loaded before default one.

The solution to this is modifying JBoss lib folder structure.
1.Move all the jar file from ${JBOSS_HOME}/lib into ${JBOSS_HOME}/lib/endorsed except getopt.jar, jboss-system.jar, jboss-jmx.jar
2.Make sure the jboss-saaj.jar and jboss-jaxrpc.jar is in it.

It works for me after I modified the structure. :)

Wednesday, June 20, 2007

Strange Generic Problem

Today my colleague asked me a question about generic in Java.
Here's the code

package test;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class TestGeneric {
public static void main(String[] args)throws Exception{
List list = new ArrayList();
list.add("test");
List newList = list;
newList.add(4);
System.out.println(list.get(1));

List list2 = new ArrayList();
list2.add(new Date());
List newList2 = list2;
newList2.add("test");
System.out.println(list2.get(0));
}
}

And an exception was thrown when executing it.
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at test.TestGeneric.main(TestGeneric.java:13)


But if I commented out line 13,it works.The thing is quite weird as if the type casting rule is applied list,why doesn't it applied on list2?Obviously,we put an integer into a list which is expecting Date object,and when we print it,it wasn't cast to Data object.Then I decompiled the class file and this is what i get.

package test;

import java.io.PrintStream;
import java.util.*;

public class TestGeneric
{

public TestGeneric()
{
}

public static void main(String args[])
throws Exception
{
List list = new ArrayList();
list.add("test");
List newList = list;
newList.add(Integer.valueOf(4));
System.out.println((String)list.get(1));
List list2 = new ArrayList();
list2.add(new Date());
List newList2 = list2;
newList2.add("test");
System.out.println(list2.get(0));
}
}

We look at line "System.out.println((String)list.get(1));" ,value in list was typecast to String object,where as "System.out.println(list2.get(0));" the value in list2 wasn't typecast to Date object.

Any idea?