File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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
Author

Unable to push messages in JBoss-JMS queue

swaraj gupta
Ranch Hand

Joined: Oct 22, 2010
Posts: 181


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(NamingServer.java:771)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:667)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at Sender.initializeSender(Sender.java:46)
at Sender.<init>(Sender.java:24)
at Sender.main(Sender.java:103)


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:



thanks,
Gurumeet Singh Ahuja
Greenhorn

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("169.144.16.104:8080", "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......


Thanks!

~Gurumeet
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to push messages in JBoss-JMS queue