<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Maxim,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Are the classes you are trying to reference multiple levels of
inner classes? Drools 4 cannot reference nested inner classes in drl. That
issue is fixed in the release for drools 5.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Joe<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <b>On Behalf Of </b>Maxim Veksler<br>
<b>Sent:</b> Monday, November 17, 2008 10:17 AM<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> [rules-users] (interesting) migration problem from Drools 3.0.6
toDrools 4.0.7<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>Hello Everyone,<br>
<br>
Here's a fun stuff to debug:<br>
<br>
<br>
In our application we are using the concept of &quot;Dynamic Beans&quot;,
Drools is running in a webapp. The servlet container is tomcat6.<br>
<br>
Dynamic beans are beans we compile from java code and then load with a custom
class loader. This happens in the following method :<br>
<br>
The class that implements ServletContextListener has in his
contextInitialized(...) method a code to do the following: (simplification)<br>
<br>
ClassLoader cl = Janino.JavaSourceClassLoader(...)<br>
originalCl = Thread.currentThread().getContextClassLoader();<br>
Thread.currentThread().setContextClassLoader(cl);<br>
<br>
The above code allowed drools3 to find the Dynamic Classes (which didn't even
existed, not to be mention were available to ANY classloader).<br>
<br>
<br>
Now, inside the .drl files we use properties from these dynamic beans - This
allows us to be dynamic on the properties we can filter by.<br>
<br>
All good, but now comes the new Drools4 code. The application is no longer able
to find the mentioned classes. <br>
The only changes the I've done was change Drools version from 3 to 4. <br>
<br>
The errors I'm getting are of the form :<br>
<br>
Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0,
no-loop=false]<br>
&nbsp;&nbsp;&nbsp; com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) :
Only a type can be imported. com.X.common.dataModel.facts.dynamic.X resolves to
a package<br>
&nbsp;&nbsp;&nbsp; com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) :
Only a type can be imported. com.X.common.dataModel.facts.dynamic.X resolves to
a package<br>
&nbsp;&nbsp;&nbsp; com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1111) :
Only a type can be imported. com.X.common.dataModel.facts.banner.X resolves to
a package<br>
&nbsp;&nbsp;&nbsp; com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) :
The import com.X.common.dataModel.facts.X.X cannot be resolved<br>
...<br>
<br>
Anyone has ideas how to over come this?<br>
<br>
I'm currently searching for alternatives, I'm thinking about Configuring my
custom class loader at the webapp level or something like that... <br>
Help would be appreciated as I'm not getting much success.<br>
<br>
-- <br>
Cheers, <br>
Maxim Veksler<br>
<br>
&quot;Free as in Freedom&quot; - Do u GNU ?<o:p></o:p></p>

</div>

</div>

</body>

</html>