Posted: Tue Apr 22, 2003 11:37 am Post subject: JMS Linked Exception???
Novice
Joined: 08 Nov 2002 Posts: 13
How do i get the linked exception in this snippet of code? It only gos into the throwable catch block. Im calling this method from another class with:
Sender.sendMessage(text);
Here's the sendmessage method:
public void sendMessage(String text) {
try {
TextMessage message = session.createTextMessage(text);
sender.send(message);
} catch (JMSException jmsx) {
System.out.println("There was an error");
jmsx.printStackTrace();
Exception ex = jmsx.getLinkedException();
if (ex != null) {
ex.printStackTrace();
}
} catch (Throwable e) {
setExceptionMessage(e);
System.out.println("Error sending message:" + message + " Reason: " + e.getMessage());
}
}
Ok, i was trying to test it by connecting to nonexistent queues and trying to put a message on those queues. That wouldnt throw a JMSException?
If it doesnt, what such test could i setup so it would throw that type of exception?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum