File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Unable to push messages in JBoss-JMS queue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Unable to push messages in JBoss-JMS queue" Watch "Unable to push messages in JBoss-JMS queue" New topic

Unable to push messages in JBoss-JMS queue

swaraj gupta
Ranch Hand

Joined: Oct 22, 2010
Posts: 182

Hi all,

l am new to JBoss and JMS. I have written a code to push messages in JMS queue as:

But getting an error as:

Exception in thread "main" javax.naming.NameNotFoundException: jms not bound
at org.jnp.server.NamingServer.getBinding(
at org.jnp.server.NamingServer.getBinding(
at org.jnp.server.NamingServer.getObject(
at org.jnp.server.NamingServer.lookup(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at sun.rmi.server.UnicastServerRef.dispatch(
at sun.rmi.transport.Transport$
at Method)
at sun.rmi.transport.Transport.serviceCall(
at sun.rmi.transport.tcp.TCPTransport.handleMessages(
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(
at sun.rmi.transport.tcp.TCPTransport$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(
at sun.rmi.transport.StreamRemoteCall.executeCall(
at sun.rmi.server.UnicastRef.invoke(
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(
at org.jnp.interfaces.NamingContext.lookup(
at javax.naming.InitialContext.lookup(
at Sender.initializeSender(
at Sender.<init>(
at Sender.main(

Please help, where am I getting wrong?

Along with that I have few queries:
1> java.naming.provider.url: What do we specify in it?
2> What's the argument for lookup method specifies on line no. 44? What should I specify as its argument?

Following is the xml snippet that I have added to ./messaging/destinations-service.xml for creating the JMS queue:

Gurumeet Singh Ahuja

Joined: Mar 02, 2012
Posts: 4
In your destinations-service.xml file
please remove this tag

<attribute name="JNDIName">Queue/MyQueue</attribute>

and while accessing it via client use like below

Sender sender = new Sender("", "MyQueue");

It should work. Or you can also check in the JmxConsole of the server what is the jndi name of your MyQueue,

And for your second query , please check the connection-factories-service.xml for the ConnectionFactory to look which fatory to use for......


I agree. Here's the link:
subject: Unable to push messages in JBoss-JMS queue
It's not a secret anymore!