Over a million developers have joined DZone.

Solving the NameNotFoundException When Connecting to IBM MQ through JMS

· Big Data Zone

Learn how you can maximize big data in the cloud with Apache Hadoop. Download this eBook now. Brought to you in partnership with Hortonworks.

If you are facing an exception like the one at [0], then the problem might be hard to figure out. Because, if you look at the Queues in the MQ explorer, the queu named FOOQ will be there.

So, the missing part here is the JMS binding of that queue. This takes 10 minutes to solve. Right click on the queue, and select ‘create JMS queue’. Pick the JNDI Context you have created (creating this is out of scope of this post), and just click next, next and finish. Now re-generate the JNDI bindings by running IVTSetup.bat, and copy it over to the client machine and use it.

Your problem should be solved by now and you will be happily putting messages to IBM MQ Queues.

[0] –

TID: [0] [ESB] [2013-03-20 19:01:11,515] ERROR {org.apache.axis2.transport.jms.JMSConnectionFactory} -  Error looking up the JMS destination with name FOOQ of typegeneric {org.apache.axis2.transport.jms.JMSConnectionFactory}
javax.naming.NameNotFoundException: dynamicQueues/FOOQ
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:1030)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:509)
at org.apache.axis2.transport.jms.JMSUtils.lookupDestination(JMSUtils.java:718)
at org.apache.axis2.transport.jms.JMSConnectionFactory.getDestination(JMSConnectionFactory.java:198)
at org.apache.axis2.transport.jms.JMSMessageSender.<init>(JMSMessageSender.java:88)
at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:120)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:316)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:175)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:408)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
TID: [0] [ESB] [2013-03-20 19:01:12,045] ERROR {org.apache.synapse.core.axis2.Axis2Sender} -  Unexpected error during sending message out {org.apache.synapse.core.axis2.Axis2Sender}
org.apache.axis2.transport.jms.AxisJMSException: Error looking up the JMS destination with name FOOQ of typegeneric
at org.apache.axis2.transport.jms.JMSConnectionFactory.handleException(JMSConnectionFactory.java:228)
at org.apache.axis2.transport.jms.JMSConnectionFactory.getDestination(JMSConnectionFactory.java:200)
at org.apache.axis2.transport.jms.JMSMessageSender.<init>(JMSMessageSender.java:88)
at org.apache.axis2.transport.jms.JMSSender.sendMessage(JMSSender.java:120)
at org.apache.axis2.transport.base.AbstractTransportSender.invoke(AbstractTransportSender.java:112)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutOnlyAxisOperationClient.executeImpl(OutOnlyAxisOperation.java:297)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.synapse.core.axis2.Axis2FlexibleMEPClient.send(Axis2FlexibleMEPClient.java:456)
at org.apache.synapse.core.axis2.Axis2Sender.sendOn(Axis2Sender.java:57)
at org.apache.synapse.core.axis2.Axis2SynapseEnvironment.send(Axis2SynapseEnvironment.java:316)
at org.apache.synapse.endpoints.AbstractEndpoint.send(AbstractEndpoint.java:329)
at org.apache.synapse.endpoints.AddressEndpoint.send(AddressEndpoint.java:59)
at org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:175)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:367)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:408)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:219)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.naming.NameNotFoundException: dynamicQueues/FOOQ
at com.sun.jndi.fscontext.RefFSContext.getObjectFromBindings(RefFSContext.java:400)
at com.sun.jndi.fscontext.RefFSContext.lookupObject(RefFSContext.java:327)
at com.sun.jndi.fscontext.RefFSContext.lookup(RefFSContext.java:146)
at com.sun.jndi.fscontext.FSContext.lookup(FSContext.java:127)
at org.wso2.carbon.context.internal.CarbonContextDataHolder$CarbonInitialJNDIContext.lookup(CarbonContextDataHolder.java:1030)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at org.apache.axis2.transport.jms.JMSUtils.lookup(JMSUtils.java:509)
at org.apache.axis2.transport.jms.JMSUtils.lookupDestination(JMSUtils.java:718)
at org.apache.axis2.transport.jms.JMSConnectionFactory.getDestination(JMSConnectionFactory.java:198)
... 20 more

Hortonworks DataFlow is an integrated platform that makes data ingestion fast, easy, and secure. Download the white paper now.  Brought to you in partnership with Hortonworks

Topics:

Published at DZone with permission of Tharindu Mathew, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}