[jboss-jira] [JBoss JIRA] Resolved: (JBRULES-2492) Classloader issue in OSGi environment

Mark Proctor (JIRA) jira-events at lists.jboss.org
Mon Nov 8 02:09:01 EST 2010


     [ https://jira.jboss.org/browse/JBRULES-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Proctor resolved JBRULES-2492.
-----------------------------------

    Resolution: Duplicate Issue


This was done as part of another JIRA, please check and let me know if things are working for you now.

> Classloader issue in OSGi environment
> -------------------------------------
>
>                 Key: JBRULES-2492
>                 URL: https://jira.jboss.org/browse/JBRULES-2492
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert)
>    Affects Versions: 5.0.1.FINAL
>         Environment: Eclipse RCP (Equinox)
>            Reporter: Cserveny Tamas
>            Assignee: Mark Proctor
>             Fix For: 5.2.0.M1
>
>
> Drools creates for each property used in a rule file a new class. This class extends a Drools base class called "org.drools.base.extractors.BaseObjectClassFieldReader".
> For the creation it will only use the classloader that defined the asserted object, this has an implication: In case the classloader loaded the asserted object does not see the drools-core.jar then it will fail.
> Steps to preproduce:
> Create two bundles: "drools" and "entities"
> Assert an entity with is defined in the "entities" package and use at least one property. 
> eg. rule "E!" 
> when
>     Entity( name == "E!" )
> then 
> end
> Workaround:
> Make sure that all classes in drools are visible in the entities. You can do that by:
> Add a dependency, Import the packages or by using the buddy loading policy settings.
> Desired solution:
> Currently the generated class is loaded by the ByteArrayClassLoader. This classloader has one parent defined. The solution should be to set a composite classloader as parent.  This classloader would first try to load the class in the classloader currently set and the would try two other alternatives:
> 1. the classloader which defined one of the classes in the drools-core.jar
> 2. the classloader set in the PackafgeBuilder config.
> This would ensure that the drools packages would be found correctly without effecting current behaviour.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list