<br><font size=2 face="Trebuchet MS">Hi</font>
<br>
<br><font size=2 face="Trebuchet MS">I still have not got any solution
of my problem that I posted previously. I have included all required jar
files and set proper class path .. Please do help ?</font>
<br>
<br><font size=2 face="Trebuchet MS">problem: </font>
<br>
<table>
<tr valign=top>
<td><font size=2 face="Trebuchet MS">I am trying to integrate Drool with
ofbiz and run application from command prompt. In one way I have integrated
it properly and I am able to run it <b>successfully.</b></font><font size=3>
<br>
</font><font size=2 face="Trebuchet MS"><b><br>
Code :</b> Which I was using initially</font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><br>
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
</font><font size=3><br>
</font><font size=2 face="Trebuchet MS"><br>
or</font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><br>
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration();</font><font size=3>
</font><font size=2 face="Trebuchet MS"><br>
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
</font><font size=3><br>
</font><font size=2 face="Trebuchet MS"><b><br>
Exception I got :</b></font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><br>
org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
<br>
:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'</font><font size=3>
</font><font size=2 face="Trebuchet MS"><br>
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
</font><font size=3><br>
</font><font size=2 face="Trebuchet MS"><br>
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
at org.drools.compiler.PackageBuilderConfiguration.&lt;init&gt;(PackageBuilderConfiguration.java:153)
at org.drools.compiler.PackageBuilder.&lt;init&gt;(PackageBuilder.java:242)
<br>
.</font><font size=3> </font><font size=2 face="Trebuchet MS"><br>
.</font><font size=3> </font><font size=2 face="Trebuchet MS"><br>
.</font><font size=3> </font><font size=2 face="Trebuchet MS"><br>
Caused by: java.lang.NullPointerException</font><font size=3> </font><font size=2 face="Trebuchet MS"><br>
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270</font><font size=3>
<br>
</font><font size=2 face="Trebuchet MS"><b><br>
Problem I found : </b><br>
In the class JavaDialectConfiguration in jar file drools-compiler.jar there
is a method named &quot;setCompliler&quot;, &nbsp;in this method Null Pointer
Exception was coming.</font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><b><br>
Solution I provided :</b></font><font size=3> </font><font size=2 face="Trebuchet MS"><br>
In my application I created my custom class CustomJavaDialectConfiguration
by extending to class JavaDialectConfiguration, In this class I overrided
the method setCompiler. My method was exactly same as that of method setCompiler
in JavaDialectConfiguration . To call my dialect class I also overrided
the method &quot;addDialect&quot; of PackageBuilderConfiguration class
. For that I created class CustomPackageBuilderConfiguration by extending
to PackageBuilderConfiguration. <br>
after that I wrote the code:</font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><br>
PackageBuilderConfiguration cfg = new CustomPackageBuilderConfiguration();</font><font size=3>
</font><font size=2 face="Trebuchet MS"><br>
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);</font><font size=3>
<br>
<br>
</font><font size=2 face="Trebuchet MS"><br>
Now application is running perfectly fine from both eclipse and command
prompt without any exception.</font><font size=3> <br>
</font><font size=2 face="Trebuchet MS"><b><br>
I want to know as my overrided method &quot;setCompiler&quot; was exactly
same then why I had to override method, and In original code (ie in drools-compiler.jar
file) why it was giving exception &nbsp;??? &nbsp;Was that due to class
lader or something else ?? &nbsp;Please do help in this regard ....</b></font><font size=3>
<br>
</font></table>
<br><font size=2 face="Trebuchet MS">&nbsp;</font>
<br>
<br><font size=2 face="Trebuchet MS">Thanks &amp; Regards:<br>
<br>
Pankaj Jain | L&amp;T infotech |Navi Mumbai<br>
Mobile: +91 9920218945<br>
Email : pankaj.jain@lntinfotech.com<br>
www.Lntinfotech.com<br>
<br>
&quot;Whatever the mind of man can conceive &amp; believe, it can achieve.&quot;<br>
<b><br>
Larsen &amp; Toubro Infotech Ltd.</b></font><font size=2 color=blue face="Trebuchet MS"><u><br>
</u></font><a href=http://www.lntinfotech.com/><font size=2 color=blue face="Trebuchet MS"><u>www.Lntinfotech.com</u></font></a><font size=2 face="Trebuchet MS"><br>
<br>
This Document is classified as: <br>
<br>
</font><input type=checkbox name=F1_chkbox checked value=on><font size=2 face="Trebuchet MS">L&amp;T
Infotech Proprietary &nbsp; </font><input type=checkbox name=F1_chkbox value=on><font size=2 face="Trebuchet MS">L&amp;T
Infotech Confidential &nbsp; </font><input type=checkbox name=F1_chkbox value=on><font size=2 face="Trebuchet MS">L&amp;T
Infotech Internal Use Only &nbsp; </font><input type=checkbox name=F1_chkbox value=on><font size=2 face="Trebuchet MS">L&amp;T
Infotech General Business &nbsp; <br>
<br>
This Email may contain confidential or privileged information for the intended
recipient (s) If you are not the intended recipient, please do not use
or disseminate the information, notify the sender and delete it from your
system. </font>

<BR>
______________________________________________________________________<BR>