R S [
https://community.jboss.org/people/rsmrsmrsm] created the discussion
"Creating a queue and ConnectionFactory"
To view the discussion, visit:
https://community.jboss.org/message/769814#769814
--------------------------------------------------------------
Hi,
if I create a queue with the command
[standalone@localhost:9999 /] jms-queue add --queue-address=TestQ --entries=queue/TestQ
--durable=false
I can't find this queue with InitialContext().lookup("queue/TestQ")
I get the error javax.naming.NameNotFoundException: queue/TestQ -- service
jboss.naming.context.java.*jboss.exported.queue.TestQ*
So, my approach was to register the queue as
jms-queue add --queue-address=TestQ --entries=jboss/exported/queue/TestQ --durable=false
As next, I have to look up the ConnectionFactory. The ConnectionFactory can be found on
the JBoss admin site with the address *java:/ConnectionFactory*
So, I look up for the factory as InitialContext.lookup("/ConnectionFactory") and
get the error javax.naming.NameNotFoundException: ConnectionFactory -- service
jboss.naming.context.java.jboss.exported.ConnectionFactory
My question is: Why I can't find the factory with "/ConnectionFactory", as
the factory can be found on the admin site with the address java:/ConnectionFactory? What
to do to solve the problem?
By the way, after registering the queue as "jboss/exported/queue/TestQ" the
queue can not be found on the jboss admin site on the JNDI view - but the lookup code
seems to work. As contrast, if I add the queue as "queue/TestQ", the queue is
visible on JNDI view - but the lookup code doesn't work.
Thank you for helping.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/769814#769814]
Start a new discussion in JNDI and Naming at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]