aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes MDB onMessage method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "MDB onMessage method" Watch "MDB onMessage method" New topic
Author

MDB onMessage method

Sridhar Karanam
Greenhorn

Joined: Feb 23, 2006
Posts: 2
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.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Is the employee class included alon with MDB.


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MDB onMessage method