[jboss-jira] [JBoss JIRA] Closed: (JBRULES-2449) OSGi like ClassLoader problem
Mark Proctor (JIRA)
jira-events at lists.jboss.org
Wed Dec 1 23:36:05 EST 2010
[ https://jira.jboss.org/browse/JBRULES-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Proctor closed JBRULES-2449.
---------------------------------
I believe this is fixed by the various recent OSGi efforts and the move to a unified composite classloader - JBRULES-2813. Please re-open with more details if the problem persists.
> OSGi like ClassLoader problem
> -----------------------------
>
> Key: JBRULES-2449
> URL: https://jira.jboss.org/browse/JBRULES-2449
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: drools-core (expert)
> Affects Versions: 5.0.1.FINAL
> Environment: kubuntu 9.10
> Reporter: Jacopo Torrini
> Assignee: Mark Proctor
> Labels: BaseObjectClassFieldReader, ClassLoader, NoDefClassFoundError, OSGi
> Fix For: 5.2.0.M1
>
>
> 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.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list