<br clear="all"><p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size: 10pt; "><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">Hi ,</font></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size: 10pt; "><font class="Apple-style-span" face="&#39;courier new&#39;, monospace"><span style="mso-spacerun:yes">    </span>Recently i was working on a drools project
where i came across certain issues and i need some help.</font></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size: 10pt; "><font class="Apple-style-span" face="&#39;courier new&#39;, monospace">In my project i
access jar at runtime by making use of the URLClassLoader.Here is the code :</font><font class="Apple-style-span" face="Arial, sans-serif"></font></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes"> </span></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes"> </span>Object object=</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">null</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes"> </span>Class myclass=</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">null</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes"> </span>URL jarPath=</span><b><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">null</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes"> </span></span><b><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:#7F0055">try</span></b><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:black">{</span><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black;background:yellow;
mso-highlight:yellow"><span style="mso-tab-count:1">      </span>jarPath</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">=</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> File(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;lib/Billing.jar&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">).toURI().toURL();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span>URLClassLoader loader = </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> URLClassLoader(</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> URL[] { <span style="background:silver;mso-highlight:silver">jarPath</span> },</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">ClassLoader.</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">getClassLoader());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span>myclass = loader.loadClass(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;dynamicclasses.Billing&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span>object = myclass.newInstance();</span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">}</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">catch</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> (Exception e)
{e.printStackTrace}</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">After getting
the class instance I will set the values and pass the object to my drools class</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">new
DroolsClass().fireRules(object);</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">The drools
class contain the following code :</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">public class
DroolsClass {</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">public</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">void</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">
fireRules(Object <span style="background:yellow;mso-highlight:yellow">object</span>){<span style="mso-tab-count:1">     </span></span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span></span><b><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">try</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> {</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>KnowledgeBase kbase = <i>readKnowledgeBase</i>();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>StatefulKnowledgeSession
ksession = kbase.newStatefulKnowledgeSession();</span><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>KnowledgeRuntimeLogger logger
= KnowledgeRuntimeLoggerFactory.<i>newFileLogger</i>(ksession, </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;test&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>ksession.insert(<span style="background:silver;mso-highlight:silver">object</span>);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>ksession.fireAllRules();<span style="mso-tab-count:5">                              </span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>logger.close();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span></span><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span><span style="mso-tab-count:1">      </span>}
</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">catch</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> (Throwable t) {</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:3">                  </span>t.printStackTrace();<span style="mso-tab-count:1">    </span></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>}</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">}</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">private</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">static</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> KnowledgeBase
readKnowledgeBase() </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#7F0055">throws</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black"> Exception {</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span></span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>KnowledgeBuilder kbuilder =
KnowledgeBuilderFactory.<i>newKnowledgeBuilder</i>();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>kbuilder.add(ResourceFactory.<i>newFileResource</i>(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;./rulefiles/testing.drl&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">), ResourceType.</span><i><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">DRL</span></i><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes">            </span>KnowledgeBuilderErrors errors =
kbuilder.getErrors();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>// </span><b><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">------ some code</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>KnowledgeBase kbase =
KnowledgeBaseFactory.<i>newKnowledgeBase</i>();</span><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span>kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:2">            </span></span><b><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">return</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> kbase;</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">}</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">Next I have a
drl file testing.drl which is present in the file directoty and which accesses
the same class </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF">dynamicclasses.Billing which is present in Billing.jar</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">Here is the
drl file content :</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">import</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">
dynamicclasses.Billing;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;rule
3&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">salience</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> 10 </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">dialect</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;mvel&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">no-loop</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">true</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-spacerun:yes">     </span>m : Billing(bplan==</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;plan1&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">)</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>


<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"><span style="mso-tab-count:1">      </span>System.out.println(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;You have
opted for plan1&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black">);<span style="mso-spacerun:yes">   </span></span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000"> </span></b></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">The problem I
encounter is when the jar i.e<span style="mso-spacerun:yes"> 
</span>Billing.jar get updated at runtime the drl file i.e testing.drl</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-pagination:none;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">The following things i am trying to
do.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">1) I will create jar at runtime and
update it if required.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">2) I will create a drl file at runtime
which will import the class present in the jar i.e. dynamicclasses.Billing</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">I am able to access the updated jar
contents in my java class ussing </span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black;background:silver;mso-highlight:silver">URLClassLoader</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> .But once i pass the
object to my drools class i get the following exception</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:red">Unable to resolve ObjectType
&#39;Billing&#39; : [Rule name=&#39;rule 3&#39;]</span><span style="font-size:10.0pt;
font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:red">Error importing :
&#39;dynamicclasses.Billing&#39;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy">java.lang.IllegalArgumentException</span></u><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red">: Could not parse
knowledge.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:red"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:red"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">If i restart my application i get no
exception since the jar is already present but the object doesn&#39;t seem to pass
to the drl and i get no result.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;mso-layout-grid-align:none;text-autospace:none"><span style="font-size:
10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;">I made the following adjustment to the
code :</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">URLClassLoader
loader = new URLClassLoader(new URL[] { jarPath
},this.getClass().getClassLoader());</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Here I get the
same exception initially. But after I restart my application it works fine and
the rule get fired and I will get the result.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">But again if I
update the jar it will access only the previous content.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">So it’s clear
that the DRL file is not able to access the jar initially or even after
updating.</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Is there any
way so that I can make it work?</span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p>

<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">Thanks.</span></p>-- <br><font face="georgia, serif"><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><p style="color:rgb(0, 0, 0);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<span style="font-family:&#39;Book Antiqua&#39;, serif;color:rgb(31, 73, 125)">Thanks &amp; Regards,</span></p><p style="color:rgb(0, 0, 0);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Book Antiqua&#39;, serif;color:rgb(31, 73, 125)">Vijeth Raj K</span></p>
<p style="color:rgb(0, 0, 0);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Book Antiqua&#39;, serif;color:rgb(31, 73, 125)">Email : <a href="mailto:vijethrajk@gmail.com" target="_blank">vijethrajk@gmail.com</a></span></p>
<p style="color:rgb(0, 0, 0);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="font-family:&#39;Book Antiqua&#39;, serif;color:rgb(31, 73, 125)"><br></span></p><p style="color:rgb(0, 0, 0);margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">
<span style="font-family:&#39;Book Antiqua&#39;, serif;color:rgb(31, 73, 125)"><br></span></p></span></font><div><br></div><br>