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

LinkageError: attempted duplicate class definition for materialized Lambda during incremental compilation

    Details

    • Sprint:
      2020 Week 04-06 (from Jan 20)
    • Story Points:
      4
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      In case of incremental compilation, say, a rule is changed:

      • A lambda consequence (or a lambda predicate) has the same expression
      • But an "import" statement is added to the rule

      It will results in

      [ERROR] testIdenticalConsequenceButImportChange[PATTERN_DSL](org.drools.modelcompiler.IncrementalCompilationTest)  Time elapsed: 3.135 s  <<< ERROR!
      java.lang.LinkageError: loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @2b0dc227 (instance of org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader, child of 'app' jdk.internal.loader.ClassLoaders$AppClassLoader) attempted duplicate class definition for org.drools.test.LambdaConsequence6F5B5EC739B778AE0EE14FA22BAFE144.
      	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:877)
      	at org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader.defineClass(DynamicProjectClassLoader.java:97)
      	at org.drools.reflective.classloader.ProjectClassLoader.defineType(ProjectClassLoader.java:183)
      	at org.drools.reflective.classloader.ProjectClassLoader.defineClass(ProjectClassLoader.java:195)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.reinitModifiedClasses(KieContainerImpl.java:323)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:243)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:236)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:194)
      	at org.drools.modelcompiler.IncrementalCompilationTest.testIdenticalConsequenceButImportChange(IncrementalCompilationTest.java:257)
      ...
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                tkobayashi Toshiya Kobayashi
                Reporter:
                tkobayashi Toshiya Kobayashi
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: