7 Replies Latest reply on Jan 23, 2014 10:24 AM by Clebert Suconic

    WildFly8: "event executor terminated" in NioEventLoop

    Wolfgang Knauf Master

      Hi community,

       

      I test a small app which is run as a JavaEE application client and sends messages to a Message Driven Bean running on WildFly8 CR1 (apparently using 4.0.13.Final).

       

      After a few send operations (might happen after three to ten retries), I see those "Warning" exceptions in the application client log, and if they occur once, the come on every send operation:

       

      21:46:01,771 WARNING [io.netty.channel.AbstractChannel] (Thread-0 (HornetQ-client-netty-threads-761289991)) Can't invoke task later as EventLoop rejected it: java.util.concurrent.RejectedExecutionException: event executor terminated

          at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:703) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:296) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:688) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:727) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.AbstractChannel$AbstractUnsafe.deregister(AbstractChannel.java:593) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:565) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelPipeline$HeadHandler.close(DefaultChannelPipeline.java:1018) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelHandlerContext.invokeClose(DefaultChannelHandlerContext.java:561) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelHandlerContext.close(DefaultChannelHandlerContext.java:546) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.ChannelDuplexHandler.close(ChannelDuplexHandler.java:73) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelHandlerContext.invokeClose(DefaultChannelHandlerContext.java:561) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelHandlerContext.access$1200(DefaultChannelHandlerContext.java:29) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.DefaultChannelHandlerContext$14.run(DefaultChannelHandlerContext.java:551) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [netty-all-4.0.13.Final.jar:4.0.13.Final]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_45]

       

       

      The client code is:

      InitialContext initialContext = new InitialContext();

      QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) initialContext.lookup("java:comp/env/jms/MBConnectionFactory");

       

      Queue queue = (Queue) initialContext.lookup("java:comp/env/jms/MBQueueRef");

       

      QueueConnection queueConnection = queueConnectionFactory.createQueueConnection(myuser, mypassword);

      QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      QueueSender queueSender = queueSession.createSender(queue);

       

      TextMessage textMessage = queueSession.createTextMessage();

      textMessage.setText(this.jTextFieldMessage.getText());

       

      queueSender.send(textMessage);

       

      queueSender.close();

      queueSession.close();

      queueConnection.close();

       

      I did a minimal config in "appclient.xml":

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.4">

          <hornetq-server>

             

              <connectors>

                  <netty-connector name="netty" socket-binding="messaging" >

                      <!--<param key="nio-remoting-threads" value="6"/>

                      <param key="use-nio" value="true"/>-->

                  </netty-connector>

              </connectors>

       

              <security-settings>

                  <security-setting match="#">

                      <permission type="createNonDurableQueue" roles="guest"/>

                      <permission type="deleteNonDurableQueue" roles="guest"/>

                      <permission type="consume" roles="guest"/>

                      <permission type="send" roles="guest"/>

                  </security-setting>

              </security-settings>

       

              <address-settings>

                  <!--default for catch all-->

                  <address-setting match="#">

                      <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                      <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                      <redelivery-delay>0</redelivery-delay>

                      <max-size-bytes>10485760</max-size-bytes>

                      <message-counter-history-day-limit>10</message-counter-history-day-limit>

                      <address-full-policy>BLOCK</address-full-policy>

                  </address-setting>

              </address-settings>

       

              <jms-connection-factories>

                  <connection-factory name="RemoteConnectionFactory">

                      <connectors>

                          <connector-ref connector-name="netty"/>

                      </connectors>

                      <entries>

                          <entry name="java:/ConnectionFactory"/>

                      </entries>

                  </connection-factory>

              </jms-connection-factories>

          </hornetq-server>

      </subsystem>

       

      The queue is declared in a "-jms.xml" file in the EJB jar, and the JNDI binding is done through "appclient-client.xml" and "jboss-client.xml".

       

      Is there something wrong with my approach? Or is this some problem in HornetQ?

       

      I can post a full self running sample if this helps

       

      Best regards

       

      Wolfgang