Here is a part of the code.
QueueReceiver receiver = ...
ObjectMessage resultMessage = (ObjectMessage) receiver.receive(sleepTime);
Serializable obj= resultMessage.getObject(); //On this line, the exception occured
Everything worked just fine in Java 5.
Looks like a JDK incompatibility issue. Report it to Sun.
But you need to include a lot more information than you have above,
e.g. a simple testcase and the stacktrace of the exception would be a start.