I am new to JMS
, was trying below sample jms
application. I have created queue connection factory ("jms/sampleQFactory") and provider queue ("jms/sampleQFactory") in the websphere
console. I have created & linked System Integration Bus (SIB) "sampleBus" with Queue connection factory. Exception is thrown while creating sender queue.
QueueSender sender = session.createSender(queue);
public void send(){
try {
InitialContext ctx = new InitialContext();
QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("jms/sampleQFactory");
Queue queue = (Queue) ctx.lookup("q/sampleSendingQ");
ctx.close();
QueueConnection connection = factory.createQueueConnection();
QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
TextMessage message = session.createTextMessage(MESSAGE);
System.out.println("Sending Message --- " + MESSAGE);
sender.send(message);
connection.close();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I am getting below error:
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R Caused by: com.ibm.ws.sib.processor.exceptions.SIMPNotPossibleInCurrentConfigurationException: CWSIK0015E: The destination sampleSendingQ was not found on messaging engine SB02861Node01.server1-SampleBus.
at com.ibm.ws.sib.processor.impl.DestinationManager.checkDestinationHandlerExists(DestinationManager.java:3855)
at com.ibm.ws.sib.processor.impl.DestinationManager.getDestination(DestinationManager.java:966)
at com.ibm.ws.sib.processor.impl.ConnectionImpl.internalCreateProducerSession(ConnectionImpl.java:1007)
at com.ibm.ws.sib.processor.impl.ConnectionImpl.createProducerSession(ConnectionImpl.java:868)
at com.ibm.ws.sib.api.jms.impl.JmsMsgProducerImpl.<init>(JmsMsgProducerImpl.java:385)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSenderImpl.<init>(JmsQueueSenderImpl.java:75)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.instantiateProducer(JmsQueueSessionImpl.java:361)
at com.ibm.ws.sib.api.jms.impl.JmsSessionImpl.createProducer(JmsSessionImpl.java:1101)
at com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:236)
at net.viralpatel.spring3.messaging.MessageProducer.send(MessageProducer.java:31)
at net.viralpatel.spring3.controller.HelloWorldController.processRequest(HelloWorldController.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1103)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:570)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:748)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:267)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.sib.processor.impl.DestinationManager.checkDestinationHandlerExists(DestinationManager.java:3855)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.sib.processor.impl.DestinationManager.getDestination(DestinationManager.java:966)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.sib.processor.impl.ConnectionImpl.internalCreateProducerSession(ConnectionImpl.java:1007)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.sib.processor.impl.ConnectionImpl.createProducerSession(ConnectionImpl.java:868)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R at com.ibm.ws.sib.api.jms.impl.JmsMsgProducerImpl.<init>(JmsMsgProducerImpl.java:385)
[6/11/14 9:02:34:435 IST] 00000029 SystemErr R ... 39 more
Please help.