5 Replies Latest reply on Jan 22, 2013 7:09 AM by komododave

    MQ Broker group - JMSException - Could not create discovery agent

    komododave

      We've created our first MQ broker group in a Fabric and are now attempting to send and receive message to/from the brokers. We're going with the default Master-Slave configuration for now.

       

      We have a fabric defined on host ourhost. We've created a project based on the External MQ Client Example. Our zookeeper.url property is defined in the POM as ourhost:2181 since we have only a single zookeeper ensemble node in the fabric. The projects are mostly identical otherwise; we have the same dependency set configured in the POM albeit with slightly newer versions.

       

      The broker group was created by running the following in the karaf shell for this single root container:

       

      mq-create --group demogroup --create-container demo-mq-1,demo-mq-2,demo-mq-3 demo-broker

       

      The project is configured with java.naming.provider.url=discovery:(fabric:demogroup). When building the project with the producer profile enabled, the following exception is reported:

       

      ERROR javax.jms.JMSException: Could not create Transport. Reason: java.io.IOException: Could not create discovery agent: fabric:demogroup

       

      Note that the project is compiled on a local machine that is not ourhost. However, there is certainly network connectivity to ourhost from the Maven build machine, as the karaf shell is contacted from there.

        • 1. Re: MQ Broker group - JMSException - Could not create discovery agent
          komododave

          Hmm it looks like this could be an authentication issue.

           

          Is there some special way to provide the JAAS username and password?

           

          I've tried passing in the connection constructor as exemplified  here:

           

          •            connection = factory.createConnection("karaf","karaf");*

           

          ..but it hasn't resolved the problem.

          • 2. Re: MQ Broker group - JMSException - Could not create discovery agent
            ffang

            Hi,

             

            For FUSE Enterprise ESB, the default username/password is admin/admin

             

            Freeman

            • 3. Re: MQ Broker group - JMSException - Could not create discovery agent
              komododave

              Thank you ffang.

               

              We've just tried this username and password but receive the same error.

               

              The modified code from that example project:

               

                          Context context = new InitialContext();

                          ConnectionFactory factory = (ConnectionFactory) context.lookup(CONNECTION_FACTORY_NAME);

                          Destination destination = (Destination) context.lookup(DESTINATION_NAME);

                          connection = factory.createConnection("admin","admin");

                          connection.start();

               

               

              He's what mvn -e -Pproducer-default prints out when run on the fabric host:

               

              exec:java {execution: default}

              10:47:59 INFO  ******************************

              10:47:59 INFO  Connecting to Fuse MQ Broker using URL: discovery:(fabric:default)

              10:47:59 INFO  ******************************

              10:48:00 INFO  Using local ZKClient

              10:48:00 INFO  Client environment:zookeeper.version=3.4.3-1240972, built on 02/06/2012 10:48 GMT

              10:48:00 INFO  Client environment:host.name=ithffu01.ocado.com

              10:48:00 INFO  Client environment:java.version=1.6.0_26

              10:48:00 INFO  Client environment:java.vendor=Sun Microsystems Inc.

              10:48:00 INFO  Client environment:java.home=/usr/lib/jvm/java-6-sun-1.6.0.26/jre

              10:48:00 INFO  Client environment:java.class.path=/usr/share/maven2/boot/classworlds.jar

              10:48:00 INFO  Client environment:java.library.path=/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64/server:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/amd64:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

              10:48:00 INFO  Client environment:java.io.tmpdir=/tmp

              10:48:00 INFO  Client environment:java.compiler=<NA>

              10:48:00 INFO  Client environment:os.name=Linux

              10:48:00 INFO  Client environment:os.arch=amd64

              10:48:00 INFO  Client environment:os.version=2.6.32-5-amd64

              10:48:00 INFO  Client environment:user.name=root

              10:48:00 INFO  Client environment:user.home=/root

              10:48:00 INFO  Client environment:user.dir=/var/tmp/external-mq-fabric-client-master

              10:48:00 INFO  Initiating client connection, connectString=localhost:2181 sessionTimeout=10000 watcher=org.linkedin.zookeeper.client.ZKClient@5a81b83c

              10:48:00 INFO  Opening socket connection to server /127.0.0.1:2181

              10:48:00 WARN  SecurityException: java.lang.SecurityException: Unable to locate a login configuration occurred when trying to find JAAS configuration.

              10:48:00 INFO  Client will not SASL-authenticate because the default JAAS configuration section 'Client' could not be found. If you are not using SASL, you may ignore this. On the other hand, if you expected SASL to work, please fix your JAAS configuration.

              10:48:00 INFO  Socket connection established to localhost/127.0.0.1:2181, initiating session

              10:48:00 INFO  Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x13c48782a180015, negotiated timeout = 10000

              10:48:00 INFO  Starting StateChangeDispatcher

              10:48:00 INFO  EventThread shut down

              10:48:00 INFO  Session: 0x13c48782a180015 closed

              10:48:00 ERROR javax.jms.JMSException: Could not connect to broker URL: discovery:(fabric:default). Reason: org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /fabric/registry/clusters/fusemq/default

              • 4. Re: MQ Broker group - JMSException - Could not create discovery agent
                ffang

                Hi,

                 

                Ensure in the $FUSE_ESB/etc/users.properties have this line

                admin=admin,admin

                 

                by default it's comment out but you should uncomment it to make authentication work.

                 

                Freeman

                • 5. Re: MQ Broker group - JMSException - Could not create discovery agent
                  komododave

                  Thanks very much for the swift response Freeman, I'll give that a go now.

                   

                  Is there a way to add an entry to this file via the karaf shell, or must we supply a customised version of it each time a new ESB container is created within a Fabric?

                   

                  EDIT: We've tried adding the admin user to fabric/instances/<esb-container-name>/etc/users.properties and restarting that container. The error message remains the same, unfortunately. Have you any other suggestions?

                   

                  EDIT2: I'm going to repost this in the Fuse MQ forums, where this should probably be!