package com.spring.trip.spring3.jms.activemq;
import java.util.Map;
import org.springframework.jms.JmsException;
import org.springframework.jms.core.JmsTemplate;
public class MessageSender
{
private final JmsTemplate jmsTemplate;
public MessageSender(final JmsTemplate jmsTemplate) {
this.jmsTemplate = jmsTemplate;
}
public void send(final Map map) throws java.lang.Exception
{
try {
jmsTemplate.convertAndSend(map);
} catch (JmsException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Above is my code, and I get the following error even though I have the try/catch block. Any help? Many Thanks!!!
No exception of type JmsException can be thrown; an exception type must be a subclass of Throwable