Suppose that we have a OSGi like environment, (a system made of plugins, each of them istantiated in a separated classloader. Each classloader has dependencies on other plugin-classloaders).

      Suppose that you have a bundle (plugin) that owns the domain model, another bundle with drools and rules on that domain model. The second plugin depends on the first.
      If you try to load the drools rules, drools throws a NoDefClassFoundError for the class org.drools.base.extractors.BaseObjectClassFieldReader.

      Investigating on code, I've found that the problem resides on the classloader used to define the pseudoclass that extract field value.
      In class org.drools.base.ClassFieldAccessorFactory, line 135, a ByteClassLoader is used to define the new class, but that byteclassloader uses the domain object classloader as parent classloader.
      In fact this byteclassloader is created by CacheEntry that is initialized with the domain object classloader, as you can see in line 275 of ClassFieldAccessorCache.

      At this point, because the field extractor is defined as a subclass of BaseObjectClassFieldReader defined in drools library, the domain object classloader is unable to find that class and throw the exception metioned above.

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  mark.proctor Mark Proctor
                  jactor_jboss Jacopo Torrini
                • Votes:
                  1 Vote for this issue
                  2 Start watching this issue


                  • Created: