title: Configure Weblogic Message Queue listener in Websphere
body: <p>I have the below requirement to be met:</p>
  
  <p>Say I have configured a JMS server, a JMS queue and a connection factory in WebLogic. Now, the message sender lies in the same WebLogic instance and able to send messages to the queue successfully. The listener part also works fine if they are in the same WebLogic instance. </p>
  
  <p>Now, my requirement is, the message listener will be part of an entirely different web application deployed on <strong>WebSphere Application Server</strong>. So basically I am trying to listen to a WebLogic queue from a WebLogic server. I have tried to google the solution and found concepts like "Foreign JMS Server" and "Message Bridges" in WebLogic. What I have understood from those is that, it  forwards the incoming message(in my case WebLogic queue) to a remote destination (WebSphere in my case). Then in the remote destination, I can deploy a listener configured as if it is listening to a local JMS queue. Is this understanding correct? In either case, what other options do I have? I don't have any requirement that the message needs to be directly available to my WebSphere queue as long as I am able to read the messages even from a remote message queue. so, if technically possible, the message forwarding is a bit overkill for my need. Any guidance or suggestion on this would be really helpful.</p>
  
  <p><strong>UPDATES:</strong></p>
  
  <p>I have tried the exact steps mentioned in both of those articles:
  <a href="http://middlewaretimes.blogspot.in/2014/06/how-to-configure-weblogic-server-with.html" rel="nofollow">http://middlewaretimes.blogspot.in/2014/06/how-to-configure-weblogic-server-with.html</a>
  <a href="http://ibswings.blogspot.in/2008/02/integrating-mq-broker-6-with-bea.html" rel="nofollow">http://ibswings.blogspot.in/2008/02/integrating-mq-broker-6-with-bea.html</a></p>
  
  <p>Since I want to use spring JMS, I have written the sender and receiver myself following this <a href="http://zachxu.blogspot.in/2010/03/create-weblogic-jms-foreign-server-and.html" rel="nofollow">tutorial</a>. However, now I am stuck at the following exception:                </p>
  
  <pre><code>org.springframework.jms.InvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
  JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
  Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
      at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:285)
      at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:496)
      at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:579)
      at InvoiceQueueSender.sendMesage(InvoiceQueueSender.java:23)
      at InvoiceSenderServlet.service(InvoiceSenderServlet.java:17)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
  Caused by: com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
  JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
  Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.
      at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:503)
      at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)
      at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1061)
      at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1019)
      at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:68)
      at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:765)
      at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:995)
      at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:886)
      at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1232)
      at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:136)
      at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:153)
      at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:254)
      at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:1142)
      at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:1123)
      at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:600)
      at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:583)
      at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:493)
      ... 21 more
  Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
      at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)
  </code></pre>