Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-2606

ThreadGroup in the default workqueue gets prematurely destroyed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2
    • 2.1.9, 2.2.6
    • Core
    • None
    • IBM JDK6

    Description

      An IllegalThreadStateException gets thrown as shown in the stack below when a new Thread is added to the default workqueue. This does not happen with the Sun JDK and it was not encountered with the IBM JDK5 either.

      The Exception gets thrown because the ThreadGroup is destroyed by the time we add the new thread because the core pool size (low watermark) is 0, the number of threads is 0 and is a daemon thread.

      Throwable occurred: java.lang.IllegalThreadStateException
              at java.lang.ThreadGroup.checkNewThread(ThreadGroup.java:147)
              at java.lang.Thread.initialize(Thread.java:332)
              at java.lang.Thread.<init>(Thread.java:267)
              at java.lang.Thread.<init>(Thread.java:225)
              at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory.newThread(AutomaticWorkQueueImpl.java:162)
              at java.util.concurrent.ThreadPoolExecutor.addThread(ThreadPoolExecutor.java:672)
              at java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(ThreadPoolExecutor.java:697)
              at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:652)
              at org.apache.cxf.workqueue.AutomaticWorkQueueImpl.execute(AutomaticWorkQueueImpl.java:249)
              at org.apache.cxf.interceptor.OneWayProcessorInterceptor.handleMessage(OneWayProcessorInterceptor.java:83)
              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
      

      A workaround is to set the lowWaterMark to something >=1 so that the ThreadGroup never gets destroyed.

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            hadrian Hadrian Zbarcea
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: