[rules-users] [rules-dev] class loading problems with 5.3.0-Final and 5.4.0-SNAPSHOT

Mauricio Salatino salaboy at gmail.com
Tue Nov 15 12:40:02 EST 2011


Interesting,
If I run the same code with the 5.4.0-SNAPSHOT patched version (commented
and uncommitted lines in JavaDialect) I get the same error that I'm getting
with 5.3.0.Final:

Exception in thread "Thread-44" java.lang.ClassCircularityError:
org/drools/spi/KnowledgeHelper
 at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
 at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
 at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at
org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:124)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
 at
org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
at
org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
 at
org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
 at
test.Rule_request_bed_3ef79db278164a0c83e4d5dee4930562DefaultConsequenceInvoker.evaluate(Rule_request_bed_3ef79db278164a0c83e4d5dee4930562DefaultConsequenceInvoker.java:16)
 at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
 at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:756)
 at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:732)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
 at
com.wordpress.salaboy.hospital.HospitalServiceImpl$1.run(HospitalServiceImpl.java:71)

As you can see it's the same exception, but the stack trace looks a little
bit different. The generated class contains a couple of UUIDs.

Cheers

On Tue, Nov 15, 2011 at 2:27 PM, Mauricio Salatino <salaboy at gmail.com>wrote:

> Mario,
> The same code with 5.3.0.Final gives me:
>
> Exception in thread "Thread-44" java.lang.ClassCircularityError:
> org/drools/spi/KnowledgeHelper
> at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:247)
> at
> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
>  at
> org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
> at
> org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at
> org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:124)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:247)
> at
> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
>  at
> org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
> at
> org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at test.Rule_request_bedDefaultConsequenceInvoker.evaluate(Unknown Source)
>  at
> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
>  at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
> at
> org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:753)
>  at
> org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:729)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
>  at
> com.wordpress.salaboy.hospital.HospitalServiceImpl$1.run(HospitalServiceImpl.java:71)
>
> I will comment the lines that you mention and go back with my simple
> project url and the version of WSO2 AS that I'm using.
> The whole installation and configuration should take only 5 minutes + the
> download time of WSO2 that is about 150mgs.
> Thanks for the help!
> Cheers
>
> On Tue, Nov 15, 2011 at 1:09 PM, Salaboy <salaboy at gmail.com> wrote:
>
>> Hi Mario thanks! Give me an hour and I will get back with more details!
>>
>>
>> - CTO @ http://www.plugtree.com
>> - MyJourney @ http://salaboy.wordpress.com
>> - Co-Founder @ http://www.jbug.com.ar
>> - Mauricio "Salaboy" Salatino -
>>
>> On 15/11/2011, at 12:47, Mario Fusco <mario.fusco at gmail.com> wrote:
>>
>> Mauricio,
>>
>> I am the author of that change, so maybe I can help.
>>
>> First of all it seems weird to me that both the 5.3.0-Final and the
>> 5.4.0-SNAPSHOT fail in the same way. I suppose the exception thrown by the
>> 5.3 should be at least slightly different because it uses a different
>> implementation of the ConsequenceGenerator. If so could you please send
>> also the exception you get with the 5.3?
>>
>> Moreover I honestly don't know what WSO2 is but I guess this issue could
>> be related with some specific constraint in its ClassLoader. Could you give
>> me some more info in order to allow me to reproduce the same problem? By
>> the way, does it happens with any rules or do you have a specific use case
>> that causes this problem?
>>
>> In the end I can give you a quick workaround, but you will have to change
>> the Drools source and of course recompile it. If you can do that you have
>> to go to the JavaDialect class:
>>
>>
>> https://github.com/droolsjbpm/drools/blob/master/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaDialect.java#L92
>>
>> comment all the lines using the new ASM*Builders (94, 98, 102, 106) and
>> uncomment the lines for the corresponding Java*Builer (92, 96, 100, 104). I
>> know this is not the ideal solution, but at least it will allow us to
>> figure out if the problem is actually where I am supposing.
>>
>> I could easily implement a fallback mechanism that will use the old
>> Builders if the new ones fail for some reason, but before to do that I'd
>> like to understand what's going on. So it will be great if you could send
>> be some more details to help me to figure out what's wrong.
>>
>> I hope this helps,
>> Mario
>>
>> On Tue, Nov 15, 2011 at 4:14 PM, Mauricio Salatino <salaboy at gmail.com>wrote:
>>
>>> Hi guys,
>>> I'm working here trying to find out a little problem that I'm having
>>> with Drools 5.4.0-SNAPSHOT and 5.3.0-Final.
>>> I'm using WSO2 container to deploy a very simple service and when a rule
>>> gets activated the following exception appears (with 5.4.0-SNAPSHOT):
>>>
>>> Exception in thread "Thread-44" java.lang.ClassCircularityError:
>>> org/drools/rule/builder/dialect/asm/ConsequenceGenerator
>>> at java.lang.Class.forName0(Native Method)
>>>  at java.lang.Class.forName(Class.java:247)
>>> at
>>> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
>>>  at
>>> org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
>>> at
>>> org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>> at
>>> org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:124)
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>> at java.lang.Class.forName0(Native Method)
>>>  at java.lang.Class.forName(Class.java:247)
>>> at
>>> org.drools.util.CompositeClassLoader$CachingLoader.load(CompositeClassLoader.java:262)
>>>  at
>>> org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:105)
>>> at
>>> org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.loadClass(JavaDialectRuntimeData.java:540)
>>>  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>>> at
>>> test.Rule_request_bed_ede4a687c29740c8bb9f13968941e6a1DefaultConsequenceInvoker.evaluate(Unknown
>>> Source)
>>>  at
>>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
>>> at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
>>>  at
>>> org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
>>> at
>>> org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:756)
>>>  at
>>> org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:732)
>>> at
>>> org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:234)
>>>  at
>>> com.wordpress.salaboy.hospital.HospitalServiceImpl$1.run(HospitalServiceImpl.java:71)
>>>
>>> I'm worried to see that I don't have any problems with 5.1.1 but with
>>> later version all throw similar issues.
>>> I will be trying to solve this issue, but if someone has a clue about
>>> what can be happening here, please let me know.
>>>
>>> I know that this can be a particular issue with WSO2, but it looks like
>>> something has changed inside drools.
>>>
>>> Cheers
>>>
>>>
>>> --
>>>  - CTO @ http://www.plugtree.com
>>>  - MyJourney @ http://salaboy.wordpress.com
>>>  - Co-Founder @ http://www.jugargentina.org
>>>  - Co-Founder @ http://www.jbug.com.ar
>>>
>>>  - Salatino "Salaboy" Mauricio -
>>>
>>>
>>> _______________________________________________
>>> rules-dev mailing list
>>> rules-dev at lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>>
>>>
>> _______________________________________________
>> rules-dev mailing list
>> rules-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-dev
>>
>>
>
>
> --
>  - CTO @ http://www.plugtree.com
>  - MyJourney @ http://salaboy.wordpress.com
>  - Co-Founder @ http://www.jugargentina.org
>  - Co-Founder @ http://www.jbug.com.ar
>
>  - Salatino "Salaboy" Mauricio -
>
>


-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111115/bfc51f48/attachment.html 


More information about the rules-users mailing list