<br><font size=2 face="Trebuchet MS">Hi</font>
<br>
<br><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>
<br>
<br><font size=2 face="Trebuchet MS"><b>Code :</b> Which I was using initially</font>
<br>
<br><font size=2 face="Trebuchet MS">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
</font>
<br>
<br><font size=2 face="Trebuchet MS">or</font>
<br>
<br><font size=2 face="Trebuchet MS">PackageBuilderConfiguration cfg =
new PackageBuilderConfiguration();</font>
<br><font size=2 face="Trebuchet MS">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
</font>
<br>
<br><font size=2 face="Trebuchet MS"><b>Exception I got :</b></font>
<br>
<br><font size=2 face="Trebuchet MS">org.drools.RuntimeDroolsException:
Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java
</font>
<br><font size=2 face="Trebuchet MS">:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'</font>
<br><font size=2 face="Trebuchet MS">at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)
</font>
<br>
<br><font size=2 face="Trebuchet MS">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)
</font>
<br><font size=2 face="Trebuchet MS">.</font>
<br><font size=2 face="Trebuchet MS">.</font>
<br><font size=2 face="Trebuchet MS">.</font>
<br><font size=2 face="Trebuchet MS">Caused by: java.lang.NullPointerException</font>
<br><font size=2 face="Trebuchet MS">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>
<br>
<br><font size=2 face="Trebuchet MS"><b>Problem I found : </b></font>
<br><font size=2 face="Trebuchet MS">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>
<br>
<br><font size=2 face="Trebuchet MS"><b>Solution I provided :</b></font>
<br><font size=2 face="Trebuchet MS">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. </font>
<br><font size=2 face="Trebuchet MS">after that I wrote the code:</font>
<br>
<br><font size=2 face="Trebuchet MS">PackageBuilderConfiguration cfg =
new CustomPackageBuilderConfiguration();</font>
<br><font size=2 face="Trebuchet MS">KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);</font>
<br>
<br>
<br><font size=2 face="Trebuchet MS">Now application is running perfectly
fine from both eclipse and command prompt without any exception.</font>
<br>
<br><font size=2 face="Trebuchet MS"><b>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>
<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>