aspose file tools*
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
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss JMS problem" Watch "JBoss JMS problem" New topic
Author

JBoss JMS problem

Roman Liekhtierov
Greenhorn

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(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:443)
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$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native 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$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at JMXTest.main(JMXTest.java:31)


Can someone help in resolwing of this problem?
Roman Liekhtierov
Greenhorn

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
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JBoss JMS problem