Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-9502

javax.naming.InvalidNameException: WFNAM00007: Invalid URL scheme name "null" when jms bridge is trying to do remote lookup on EAP6/HornetQ

    Details

    • Steps to Reproduce:
      Hide

      Start EAP 6 with port offset to 1000

      jboss-eap-6.4/bin/standalone.sh -c standalone-full.xml -Djboss.socket.binding.port-offset=1000
      

      Create jms queue on EAP6

      /subsystem=messaging/hornetq-server=default/jms-queue=TargetQueue:add(durable=true, entries=["java:jboss/exported/jms/queue/targetQueue"])
      

      Start EAP7/WildFly using standalone-full.xml:

      wildfly-12.0.0.Alpha1-SNAPSHOT/bin/standalone.sh -c standalone-full.xml
      

      Create source queue on EAP7 and then try to create the bridge

      /subsystem=messaging-activemq/server=default/jms-queue=SourceQueue:add(durable=true, entries=["java:/jms/queue/sourceQueue"])
       
       
      /subsystem=messaging-activemq/jms-bridge=testBridge:add(module="org.hornetq.client", quality-of-service=AT_MOST_ONCE, failure-retry-interval=2500, max-retries=10, max-batch-size=200, max-batch-time=60, source-connection-factory=ConnectionFactory, source-destination="jms/queue/sourceQueue", target-connection-factory="jms/RemoteConnectionFactory", target-destination="jms/queue/targetQueue", target-context={"java.naming.factory.initial" => "org.jboss.naming.remote.client.InitialContextFactory", "java.naming.provider.url" => "remote://localhost:5447"})
      
      

      Note that you need to add dependency on org.wildfly.naming-client to org.hornetq.client module

      Show
      Start EAP 6 with port offset to 1000 jboss-eap-6.4/bin/standalone.sh -c standalone-full.xml -Djboss.socket.binding.port-offset=1000 Create jms queue on EAP6 /subsystem=messaging/hornetq-server=default/jms-queue=TargetQueue:add(durable=true, entries=["java:jboss/exported/jms/queue/targetQueue"]) Start EAP7/WildFly using standalone-full.xml: wildfly-12.0.0.Alpha1-SNAPSHOT/bin/standalone.sh -c standalone-full.xml Create source queue on EAP7 and then try to create the bridge /subsystem=messaging-activemq/server=default/jms-queue=SourceQueue:add(durable=true, entries=["java:/jms/queue/sourceQueue"])     /subsystem=messaging-activemq/jms-bridge=testBridge:add(module="org.hornetq.client", quality-of-service=AT_MOST_ONCE, failure-retry-interval=2500, max-retries=10, max-batch-size=200, max-batch-time=60, source-connection-factory=ConnectionFactory, source-destination="jms/queue/sourceQueue", target-connection-factory="jms/RemoteConnectionFactory", target-destination="jms/queue/targetQueue", target-context={"java.naming.factory.initial" => "org.jboss.naming.remote.client.InitialContextFactory", "java.naming.provider.url" => "remote://localhost:5447"}) Note that you need to add dependency on org.wildfly.naming-client to org.hornetq.client module

      Description

      When I create jms bridge on EAP7 that tries to connect to EAP6, it throws following issue when trying to do remote lookup for connection factory or destination on EAP6.

      2017-10-31 09:44:18,769 WARN  [org.apache.activemq.artemis.jms.bridge] (Thread-102) AMQ342010: Failed to connect JMS Bridge N/A: javax.naming.InvalidNameException: WFNAM00007: Invalid URL scheme name "null"
      	at org.wildfly.naming.client.WildFlyRootContext.getProviderContext(WildFlyRootContext.java:808)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:140)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at org.apache.activemq.artemis.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:46)
      	at org.apache.activemq.artemis.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:32)
      	at org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1072)
      	at org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.setupJMSObjectsWithRetry(JMSBridgeImpl.java:1247)
      	at org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl.access$2600(JMSBridgeImpl.java:75)
      	at org.apache.activemq.artemis.jms.bridge.impl.JMSBridgeImpl$FailureHandler.run(JMSBridgeImpl.java:1747)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      

      When debugging I noticed that WildFlyRootContext.getProviderContext there's no NamingProviderFactory available to resolve the name, so I think the error message is just a consequence of that.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  gaol Lin Gao
                  Reporter:
                  msvehla Martin Švehla
                  Tester:
                  Martin Švehla
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: