简体   繁体   中英

Not finding named JMS queue on Red Hat EAP 7.3

Writing a simple JMS client I am getting:

09:00:59.771 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
09:00:59.774 [main] INFO org.wildfly.naming - WildFly Naming version 1.0.13.Final
09:00:59.905 [main] INFO org.wildfly.security - ELY00001: WildFly Elytron version 1.1.0.Final
09:00:59.963 [main] INFO org.xnio - XNIO version 3.5.1.Final
09:00:59.974 [main] INFO org.xnio.nio - XNIO NIO Implementation Version 3.5.1.Final
09:01:00.524 [XNIO-1 I/O-1] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 I/O-1', selector sun.nio.ch.WindowsSelectorImpl@497899f6
09:01:00.525 [XNIO-1 Accept] DEBUG org.xnio.nio - Started channel thread 'XNIO-1 Accept', selector sun.nio.ch.WindowsSelectorImpl@25c2b866
09:01:00.532 [main] INFO org.jboss.remoting - JBoss Remoting version 5.0.0.Final
09:01:01.549 [main] DEBUG org.apache.commons.beanutils.converters.BooleanConverter - Setting default value: false
...
09:01:02.015 [main] DEBUG org.apache.commons.beanutils.converters.StringConverter - Converting 'Integer' value '65536' to type 'String'
Got ConnectionFactory
Attempting to acquire destination "jms/queue/ExternalSignalQueue"
javax.naming.NameNotFoundException: jms/queue/ExternalSignalQueue -- service jboss.naming.context.java.jboss.exported.jms.queue.ExternalSignalQueue
    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
    at org.wildfly.naming.client.remote.RemoteServerTransport.handleLookup(RemoteServerTransport.java:200)
    at org.wildfly.naming.client.remote.RemoteServerTransport$1.handleMessage(RemoteServerTransport.java:120)
    at org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:430)
    at org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:991)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:748)

with the corresponding Java code

String destinationString = "java:jms/queue/ExternalSignalQueue"; 
ConnectionFactory connectionFactory = (ConnectionFactory) namingContext.lookup(connectionFactoryString);
System.out.println("Got ConnectionFactory");
System.out.println("Attempting to acquire destination \"" + destinationString + "\"");
Destination destination = (Destination) namingContext.lookup(destinationString);

for the following Destination (per the management console):

ExternalSignalQueue   
Queue Address:     jms.queue.ExternalSignalQueue
JNDI Names:        java:/jms/queue/ExternalSignalQueue,java:jboss/exported/jms/queue/ExternalSignalQueue

What is the queue name, as it should be specified in Java (and why)? I have also tried using java:jboss/exported/jms/queue/ExternalSignalQueue and queue/ExternalSignalQueue as the queue name - with the same error but different queue "names" seeming to be checked.

This is the XML for the subsystem:

       <subsystem xmlns="urn:jboss:domain:messaging-activemq:8.0">
            <server name="default">
                <statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/>
                <security-setting name="#">
                    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                    <role name="admin" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                </security-setting>
                <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
                <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                    <param name="batch-delay" value="50"/>
                </http-connector>
                <in-vm-connector name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-connector>
                <http-acceptor name="http-acceptor" http-listener="default"/>
                <http-acceptor name="http-acceptor-throughput" http-listener="default">
                    <param name="batch-delay" value="50"/>
                    <param name="direct-deliver" value="false"/>
                </http-acceptor>
                <in-vm-acceptor name="in-vm" server-id="0">
                    <param name="buffer-pooling" value="false"/>
                </in-vm-acceptor>
                <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
                <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
                <jms-queue name="ExternalSignalQueue" entries="java:/jms/queue/ExternalSignalQueue,java:jboss/exported/jms/queue/ExternalSignalQueue"/>  
                <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
                <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
                <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
            </server>
        </subsystem>

I believe you should be using jms/queue/ExternalSignalQueue rather than java:jms/queue/ExternalSignalQueue . This is because jms/queue/ExternalSignalQueue is what appears after java:jboss/exported/ in the JNDI binding (which is what is made available to remote JNDI clients).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM