2 Replies Latest reply on Aug 14, 2013 5:54 AM by psrklr

    Getting ERROR log while I am consuming a queue

    mcroce

      Guys,

       

      I am developing a queue consumer that is scheduled by 5 minutes:

       

      The class is:

       

      @Stateless(name="AutomaticSchedulerBean")

      public class AutomaticSchedulerBean implements MessageListener

      {

           //@Schedule(dayOfWeek = "*", hour = "*/1", minute = "*", second = "*",year="2012", persistent = false)

                @Schedule(dayOfWeek = "*", hour = "*/1", minute = "*/2",year="2012", persistent = false)

           public void backgroundProcessing(){

                     //System.out.println("\n\n\t AutomaticSchedulerBean's backgroundProcessing() called....at: "+new Date());

                     this.receive();

                 }

          

           private boolean stop = false;

       

       

       

       

       

       

                 public void receive()

                           {

                           try

                                     {

                                     // Strings for JNDI names

                                     String factoryName = "jms/RemoteConnectionFactory";

                                     String queueName =  "TestQ";

                                     // Create an initial context.

                                     Properties props = new Properties();

                                     props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

                                     props.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");

                                     props.put(Context.SECURITY_PRINCIPAL, "testuser");

                                     props.put(Context.SECURITY_CREDENTIALS, "testpassword");

                                     InitialContext context = new InitialContext(props);

       

                                     QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(factoryName);

                                     Queue queue = (Queue) context.lookup(queueName);

                                     context.close();

                                     // Create JMS objects

                                     QueueConnection connection = factory.createQueueConnection("testuser","testpassword");

                                     QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

                                     QueueReceiver receiver = session.createReceiver(queue);

                                     receiver.setMessageListener(this);

                                     connection.start();

       

                                     // Wait for stop

                                     Thread.sleep(10000);

                                     // Exit

       

                                     System.out.println("Exiting...");

                                     receiver.close();

                                     session.close();

                                     connection.close();

       

                                     System.out.println("Goodbye!");

                                     }

                           catch (Exception e)

                                     {

                                     e.printStackTrace();

                                     System.exit(1);

                                     }

                           }

       

       

       

                 public void onMessage(Message message){

                           try{

                                     String msgText = ((TextMessage) message).getText();

                                     System.out.println("MENSAJE llego: " + msgText);

                                     if ("stop".equals(msgText)){

                                               stop = true;

                                     }

                           }catch (JMSException e){

                                     e.printStackTrace();

                                     stop = true;

                           }

                 }

       

      }

       

       

      I am getting in the server log each time that the bean is executed:

       

       

      17:27:29,521 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment queuePaymentScheduled.jar in 37ms

      17:27:29,523 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "queuePaymentScheduled.jar"

      17:27:29,564 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-7) JNDI bindings for session bean named AutomaticSchedulerBean in deployment unit deployment "queuePaymentScheduled.jar" are as follows:

       

       

                java:global/queuePaymentScheduled/AutomaticSchedulerBean!javax.jms.MessageListener

                java:app/queuePaymentScheduled/AutomaticSchedulerBean!javax.jms.MessageListener

                java:module/AutomaticSchedulerBean!javax.jms.MessageListener

                java:global/queuePaymentScheduled/AutomaticSchedulerBean

                java:app/queuePaymentScheduled/AutomaticSchedulerBean

                java:module/AutomaticSchedulerBean

       

       

      17:27:29,622 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018565: Replaced deployment "queuePaymentScheduled.jar" with deployment "queuePaymentScheduled.jar"

      17:27:53,863 INFO  [org.jboss.as.naming] (Remoting "crocem" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 29206283 (inbound) of Remoting connection 012277f1 to null

      17:28:00,045 ERROR [org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1] (Remoting "config-based-naming-client-endpoint" task-3) Channel end notification received, closing channel Channel ID c28a9420 (outbound) of Remoting connection 01a15545 to null

      17:28:00,046 INFO  [org.jboss.as.naming] (Remoting "crocem" task-2) JBAS011806: Channel end notification received, closing channel Channel ID 428a9420 (inbound) of Remoting connection 00aaf302 to null

      17:28:06,857 INFO  [stdout] (Thread-7 (HornetQ-client-global-threads-16772930)) MENSAJE llego: MAXI

       

       

      17:28:10,058 INFO  [stdout] (EJB default - 5) Exiting...

       

       

      17:28:10,732 INFO  [stdout] (EJB default - 5) Goodbye!

       

       

      17:30:00,044 INFO  [org.jboss.as.naming] (Remoting "crocem" task-3) JBAS011806: Channel end notification received, closing channel Channel ID 6ce3a467 (inbound) of Remoting connection 0173f254 to null

      17:30:00,045 ERROR [org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1] (Remoting "config-based-naming-client-endpoint" task-3) Channel end notification received, closing channel Channel ID ece3a467 (outbound) of Remoting connection 012aa50a to /127.0.0.1:4447

      17:30:10,052 INFO  [stdout] (EJB default - 6) Exiting...

       

       

      17:30:10,057 INFO  [stdout] (EJB default - 6) Goodbye!

       

       

      17:32:00,043 INFO  [org.jboss.as.naming] (Remoting "crocem" task-2) JBAS011806: Channel end notification received, closing channel Channel ID 55be88f9 (inbound) of Remoting connection 01529ca9 to null

      17:32:00,043 ERROR [org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1] (Remoting "config-based-naming-client-endpoint" task-3) Channel end notification received, closing channel Channel ID d5be88f9 (outbound) of Remoting connection 017ea84b to /127.0.0.1:4447

      17:32:10,089 INFO  [stdout] (EJB default - 7) Exiting...

       

       

      17:32:10,094 INFO  [stdout] (EJB default - 7) Goodbye!

       

       

      Anyway, I have a breakpoint on the onMessage method and it is entering and is taking the queue messages without any problem.

       

      How can I resolve this ERROR because I don´t know if it is a big problem ?

       

      Thanks,

      Maxi

        • 1. Re: Getting ERROR log while I am consuming a queue
          jbertram

          That ERROR message is not coming from HornetQ.  It is coming from the JNDI implementation in AS7. 

           

          In any event I believe you can safely ignore that message as I think it is harmless.  I believe the issue has been resolved in the latest AS7 nightly if you wish to try it.

          • 2. Re: Getting ERROR log while I am consuming a queue
            psrklr

            Use below properties

            Properties props = new Properties();

            props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

                                          

            rather the one you using below.

             

            Properties props = new Properties();

            props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

            props.put(Context.PROVIDER_URL, "remote://127.0.0.1:4447");

            props.put(Context.SECURITY_PRINCIPAL, "testuser");

            props.put(Context.SECURITY_CREDENTIALS, "testpassword");


            I got same issue what you mentioned below. It got resovled after changing to above property.

            Ensure that your EJB jndi value should start with 'ejb:'