<br>&nbsp;&nbsp; Ok, you got me hooked by my curiosity now. :)<br><br>&nbsp;&nbsp; I know Drools internals, but I unfortunately know nothing about Eclipse internals (maybe I can learn something today). So, we will need to work together on this, ok?<br>
<br>&nbsp;&nbsp; First things first, can you please update to M3? Besides possible bug fixes, it way will be easier to debug things since line numbers will match.<br><br>&nbsp;&nbsp; Drools works AFAIK pretty well in App Servers. Yes, it creates custom classloaders internally because it needs to generate classes, but it does respect classloader hierarchy as much as I know it is possible.<br>
<br>&nbsp;&nbsp; The two ways to tell Drools about facts being in a different classloader hierarchy are:<br><br>* Either set the fact classloaders explicitly on *both* PackageBuilderConfiguration and RuleBaseConfiguration for compile-time and runtime respectivelly. This is my preferred approach.<br>
* Or, if a classloader is not set in the configuration objects, Drools will look for the ThreadContext set classloader. <br><br>&nbsp;&nbsp; The above covers the use cases for JEE containers and I am not aware of any problems. <br>
<br>&nbsp;&nbsp; Now, how Eclipse differs from that? What does it means to set a plugin as &quot;buddy&quot; of another? Sorry if the question is too basic, but never played with Eclipse plugins before.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br>
<br><div class="gmail_quote">2008/12/3 keithnielsen <span dir="ltr">&lt;<a href="mailto:keithnielsen@discover.com">keithnielsen@discover.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Since my last post was so nicely hijacked I have started a new thread in the<br>
hopes that the Drools team can shed some light on this.<br>
<br>
My setup is as follows:<br>
<br>
1) 2 plug-ins, one containing the drools libraries, and a second plugin<br>
containing the facts and the rule file.<br>
2) The rules engine plugin has a buddy-policy of &quot;registered&quot; and the facts<br>
plugin has the rules engine plugin as a registered buddy.<br>
<br>
<br>
Here is the rule(although any fact that has field assignments fails)<br>
<br>
rule &quot;Retrieve CID Presentation Model&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;ruleflow-group &quot;RetrieveCID&quot;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
<br>
CIDPresentationModel($cidValue:cidValue,$cidExpirationDate:expirationDate)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;boolean cidResult =<br>
cidService.verifyCIDIsValid($cidValue,$cidExpirationDate);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CIDResult result = new CIDResult(cidResult);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;insert(result);<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(&quot;Executing: Retrieve CID Presentation<br>
Model&quot;);<br>
end<br>
<br>
Deep in the bowels of drools there is a call to<br>
ClassFieldAccessorFactory.getClassFieldReader where it attempts to create a<br>
class using the byte array classloader, i.e. final Class&lt;?&gt; newClass =<br>
byteArrayClassLoader.defineClass(className, bytes,PROTECTION_DOMAIN). Its at<br>
this point that a NoClassDefFoundError on the BaseObjectClassFieldReader. I<br>
am a little concerned when I see what appears to be a custom classloader<br>
since if you are going to embed the rules engine it should respect the<br>
classloader hierachy from the container, whether that be an app server like<br>
Websphere or client side container like Eclipse.<br>
<br>
I am wondering if the team has had success with this particular setup (the<br>
examples for Drools work cause they are all in the same plugin). I have made<br>
the example as simple as possible but still no luck. Seems like this is<br>
pretty basic functionality so I can&#39;t imagine this hasn&#39;t been tested.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/Embedding-Drools-in-Eclipse-tp20814423p20814423.html" target="_blank">http://www.nabble.com/Embedding-Drools-in-Eclipse-tp20814423p20814423.html</a><br>
Sent from the drools - user mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br> &nbsp;Edson Tirelli<br> &nbsp;JBoss Drools Core Development<br> &nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>