This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes JBoss JMS problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss JMS problem" Watch "JBoss JMS problem" New topic

JBoss JMS problem

Roman Liekhtierov

Joined: Jul 24, 2012
Posts: 2
I try to send message to JMS queue to JBoss

And got exception:

javax.naming.NameNotFoundException: ConnectionFactoryJndi 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(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$ Source)
at Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$ Source)
at Source)
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 JMXTest.main(

Can someone help in resolwing of this problem?
Roman Liekhtierov

Joined: Jul 24, 2012
Posts: 2
I think it can be possible on another JVM. But how I can start this client on the same JVM as JBoss AS?
Peter Johnson

Joined: May 14, 2008
Posts: 5852

Roman Liekhtierov wrote:But how I can start this client on the same JVM as JBoss AS?

You can't. This is a standalone Java app (it has a "main" method. Such apps can be run only from their own JVM.

As far as you code goes, on line 32/33, you want to look up "ConnectionFactory":
ConnectionFactory connectionFactory = (ConnectionFactory)init.lookup("ConnectionFactory");

And on line 30, the typical location for a queue is "queue/<name>", thus you want (assuming line 30 has the correct queue name):
Queue notify = (Destination)init.lookup("queue/QueueJNDI");

JBoss In Action
subject: JBoss JMS problem
It's not a secret anymore!