Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-144

LinkageError exception during multi-threaded execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • None
    • 5.5.0.Final, 6.0.0.Beta2
    • None
    • None
    • Hide

      Use the main thread and a second thread, dedicated to fireAllRules.
      The exception is not easy to reproduce and may be platform-specific - or at
      least jvm specific.
      In my case, I had a single rule "when accumulate(...) then ... end"

      Show
      Use the main thread and a second thread, dedicated to fireAllRules. The exception is not easy to reproduce and may be platform-specific - or at least jvm specific. In my case, I had a single rule "when accumulate(...) then ... end"

      The exception is thrown in org.drools.rule.JavaRuntimeDialectData, when the CompositeClassLoader tries to define the class implementing a rule consequence. The method fastFindClass, which does the lazy initialization, is not thread-safe. It is possible for two threads to call findLoadedClass(..), get null and thus start the definition process which eventually results in the exception.

      The situation is indeed very rare

            mfusco@redhat.com Mario Fusco
            dsotty Davide Sottara (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: