7 Replies Latest reply on Dec 3, 2008 8:25 AM by timfox

    Exception in thread "Thread-108" - java.util.NoSuchElementEx

    prakashmvc

      Hi,
      I am working on Migrating JBossMQ to JbossMessaging.
      Currently I am using Jboss-messaging-1.4.0.SP3-CP04, which is a fixpack 4 for Jbossmessaging 1.4.0.SP3.
      This is not an official release from JbossMessaging. I took from Jboss CVS repository.

      However I got the following exception while processing messages.

      25/10/2008 01:16:37,475 ERROR STDERR Exception in thread "Thread-108"

      25/10/2008 01:16:37,476 ERROR STDERR java.util.NoSuchElementException

      25/10/2008 01:16:37,476 ERROR STDERR at java.util.LinkedList.remove(LinkedList.java:644)

      25/10/2008 01:16:37,476 ERROR STDERR at java.util.LinkedList.removeFirst(LinkedList.java:134)

      25/10/2008 01:16:37,477 ERROR STDERR at java.util.LinkedList.poll(LinkedList.java:475)

      25/10/2008 01:16:37,485 ERROR STDERR at org.jboss.messaging.util.OrderedExecutorFactory$ChildExecutor.run(OrderedExecutorFactory.java:126)

      25/10/2008 01:16:37,485 ERROR STDERR at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

      25/10/2008 01:16:37,485 ERROR STDERR at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

      25/10/2008 01:16:37,486 ERROR STDERR at java.lang.Thread.run(Thread.java:595)

      How to resolve the above exception? Is there any configuration missing or is an known exception which doesn't affect the functionality?

      Regards,
      Prakash

        • 1. Re: Exception in thread
          timfox

          This looks like a bug in the orderedexecutorfactory shutdown:

          public void shutdownNow()
           {
           tasks.clear();
           }
          


          which is not synchronized.

          • 2. Re: Exception in thread
            prakashmvc

            Thanks Tim, for the earliest reply..

            Kindly let me know, will this fix will be available in upcoming version of JbossMessaging i.e. JbossMessaging 1.4.1GA.

            and when is the paln to release JbossMessaging 1.4.1GA. I believe this version will fix lot of issues.

            Regards,
            Prakash

            • 3. Re: Exception in thread
              gaohoward

              Tim is right, fix should be:

               public void shutdownNow()
               {
               synchronized (tasks)
               {
               tasks.clear();
               shutdown = true;
               }
               }
              


              • 4. Re: Exception in thread
                prakashmvc

                Hi,
                Thanks for the complte code provided..

                we are already using patched version of the jbossmessaging 1.4.0.SP3.
                i.e. Jboss-messaging-1.4.0.SP3-CP04.
                If we modify the code it's somethong like hacking the Jboss-messaging-1.4.0.SP3-CP04.

                At the moment we don't want to do that and we are completely rely on the next upcoming release of jbossmessaging.

                Kindly do let us know, when we can expect next release.

                Regards,
                Prakash

                • 5. Re: Exception in thread
                  jamesmcilroy

                  Hi, is this any closer to be resolved with a release, or would we need to patch this ourselves still?

                  • 6. Re: Exception in thread
                    timfox

                    It's in the latest EAP CP.

                    • 7. Re: Exception in thread
                      timfox

                      Actually the next CP.

                      FYI you can always see what release a task is in by looking in JIRA:

                      https://jira.jboss.org/jira/browse/JBMESSAGING-1434

                      You can see it's already fixed, and will be in releases 1.4.2.GA and 1.4.0.SP3.CP05.

                      Clicking on 1.4.0.SP3.CP05 tells you in the description "This release goes in EAP 4.3 CP04 "

                      You can of course just take the change from svn yourself if you don't have a support contract, It's a very simple change.