Forums Register Login

MDB onMessage method

+Pie Number of slices to send: Send
Hi Everybody,

I am trying an application where i am sending an Object message from a helper class to a queue, i a using the following code for that :

QueueSession queueSession = getSession();
QueueSender queueSender = null;
Queue queue = null;
ObjectMessage object =null;
try{
queue = getQueue();
queueSender = queueSession.createSender(queue);
object = queueSession.createObjectMessage(emp);

// here emp is a serializable java object which has two string variables empName and empDept

queueSender.send(getQueue(),object);
}catch(JMSException){
// some code
}

And in the MDB in the onMessage i check for an object message, but the below line gives me an error:

onMessage(Message message){
if (message instanceof ObjectMessage && ((ObjectMessage) message).getObject() instanceof Employee)
{
// some code
}
}

javax.jms.MessageFormatException: ClassNotFoundException: No ClassLoader
s found for: com.employee.details.Employee where Employee is the object whichi have sent as object message.

Anybody could give a suggestion, would be of great help for me.
Thanks for any help.
Sridhar.
+Pie Number of slices to send: Send
Is the employee class included alon with MDB.
That feels good. Thanks. Here's a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 919 times.
Similar Threads
Getting very strange exception: JMS in EJB3, JBoss
JMS temporary queue weblogic
MessageListener in AQ JMS
Error deserializing Object
sending org.jdom.Document object over JMS
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:17:40.