<br><font size=2 face="Trebuchet MS">Hi </font>
<br>
<br><font size=2 face="Trebuchet MS">you r right, When I run the application
(integrated with OFBiz) from command prompt &nbsp;I get the NPE: in line</font>
<br>
<br><tt><font size=2>getClass().getClassLoader().loadClass( &quot;org.eclipse.jdt.internal.compiler.Compiler&quot;
);</font></tt>
<br>
<br><font size=2 face="Trebuchet MS">When I run the application (ofcourse
integrated with OFBiz) &nbsp;from eclipse I don't get NPE exception.</font>
<br>
<br>
<br><font size=2 face="Trebuchet MS">In ofbiz we have a batch file named
startofbiz.bat to run the application, inside this I configured the classpath
by this</font>
<br>
<br>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\antlr-runtime.jar</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-api.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-compiler.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-core.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-decisiontables.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-jsr94.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\drools-templates.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\joda-time.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\jsr94.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\jxl.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\mvel2.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\org.eclipse.jdt.core_3.4.4.v_894_R34x.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\xpp3.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\xpp3_min.jar
%VMARGS%</font>
<br><font size=2 face="Trebuchet MS">set VMARGS=-Xbootclasspath/p:applications\order\lib\xstream.jar
%VMARGS%</font>
<br>
<br>
<br>
<br><font size=2 face="Trebuchet MS">If i don't do this I get the class
not found exception</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>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="Trebuchet MS"><b>Greg Barton &lt;greg_barton@yahoo.com&gt;</b>
</font>
<br><font size=1 face="Trebuchet MS">Sent by: rules-users-bounces@lists.jboss.org</font>
<p><font size=1 face="Trebuchet MS">07/28/2009 11:29 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="Trebuchet MS">Please respond to<br>
Rules Users List &lt;rules-users@lists.jboss.org&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="Trebuchet MS">To</font></div>
<td><font size=1 face="Trebuchet MS">Rules Users List &lt;rules-users@lists.jboss.org&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="Trebuchet MS">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="Trebuchet MS">Subject</font></div>
<td><font size=1 face="Trebuchet MS">Re: [rules-users] Run Drool Application
>From Command Prompt</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2><br>
It's unclear from your post when you get the NPE: from the command line,
from eclipse, or when integrated with OFBiz. (I assume you're referring
to http://ofbiz.apache.org/)<br>
<br>
It's undoubtedly a classpath issue. &nbsp;Just peek at the source a bit.
&nbsp;I'm not sure what version you're using, but if you look at the source
in the svn repo you'll see that line 92 of JavaDialectConfiguration is
this:<br>
<br>
getClass().getClassLoader().loadClass( &quot;org.eclipse.jdt.internal.compiler.Compiler&quot;
);<br>
<br>
See the javadoc for Class.getClassLoader() that says &quot;Returns the
class loader for the class. Some implementations may use null to represent
the bootstrap class loader. This method will return null in such implementations
if this class was loaded by the bootstrap class loader.&quot;<br>
<br>
So, it looks probable that in the environment that's having problems, the
JavaDialectConfiguration class is loaded by the bootstrap classloader.
&nbsp;What is the VM implementation you're using?<br>
<br>
It might be best if Thread.currentThread().getContextClassLoader() was
used instead of getClass().getClassLoader() in JavaDialectConfiguration
and elsewhere. &nbsp;Devs, have an opinion on that?<br>
<br>
--- On Mon, 7/27/09, Pankaj.Jain@lntinfotech.com &lt;Pankaj.Jain@lntinfotech.com&gt;
wrote:<br>
<br>
&gt; From: Pankaj.Jain@lntinfotech.com &lt;Pankaj.Jain@lntinfotech.com&gt;<br>
&gt; Subject: Re: [rules-users] Run Drool Application From Command Prompt<br>
&gt; To: rules-users@lists.jboss.org<br>
&gt; Date: Monday, July 27, 2009, 11:50 PM<br>
&gt; <br>
&gt; <br>
&gt; Hi<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; I still have not got any<br>
&gt; solution<br>
&gt; of my problem that I posted previously. I have included all<br>
&gt; required jar<br>
&gt; files and set proper class path .. Please do help ?<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; problem: <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; I am trying to<br>
&gt; integrate Drool with<br>
&gt; ofbiz and run application from command prompt. In one way I<br>
&gt; have integrated<br>
&gt; it properly and I am able to run it<br>
&gt; successfully.<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Code : Which I was using initially <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; KnowledgeBuilder kbuilder =<br>
&gt; KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; or <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; PackageBuilderConfiguration cfg = new<br>
&gt; PackageBuilderConfiguration();<br>
&gt; <br>
&gt; <br>
&gt; KnowledgeBuilder kbuilder =<br>
&gt; KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Exception I got : <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; org.drools.RuntimeDroolsException: Unable to load dialect<br>
&gt; 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java<br>
&gt; <br>
&gt; <br>
&gt; :org.drools.rule.builder.dialect.java.JavaDialectConfiguration'<br>
&gt; <br>
&gt; <br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)<br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:259)<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)<br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.&lt;init&gt;(PackageBuilderConfiguration.java:153)<br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilder.&lt;init&gt;(PackageBuilder.java:242)<br>
&gt; <br>
&gt; <br>
&gt; . <br>
&gt; <br>
&gt; . <br>
&gt; <br>
&gt; . <br>
&gt; <br>
&gt; Caused by: java.lang.NullPointerException <br>
&gt; <br>
&gt; at<br>
&gt; org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:92)<br>
&gt; at<br>
&gt; org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:55)<br>
&gt; at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Problem I found : <br>
&gt; <br>
&gt; In the class JavaDialectConfiguration in jar file<br>
&gt; drools-compiler.jar there<br>
&gt; is a method named &quot;setCompliler&quot;, &nbsp;in this<br>
&gt; method Null Pointer<br>
&gt; Exception was coming. <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Solution I provided :<br>
&gt; <br>
&gt; <br>
&gt; In my application I created my custom class<br>
&gt; CustomJavaDialectConfiguration<br>
&gt; by extending to class JavaDialectConfiguration, In this<br>
&gt; class I overrided<br>
&gt; the method setCompiler. My method was exactly same as that<br>
&gt; of method setCompiler<br>
&gt; in JavaDialectConfiguration . To call my dialect class I<br>
&gt; also overrided<br>
&gt; the method &quot;addDialect&quot; of<br>
&gt; PackageBuilderConfiguration class<br>
&gt; . For that I created class<br>
&gt; CustomPackageBuilderConfiguration by extending<br>
&gt; to PackageBuilderConfiguration. <br>
&gt; <br>
&gt; after that I wrote the code: <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; PackageBuilderConfiguration cfg = new<br>
&gt; CustomPackageBuilderConfiguration();<br>
&gt; <br>
&gt; <br>
&gt; KnowledgeBuilder kbuilder =<br>
&gt; KnowledgeBuilderFactory.newKnowledgeBuilder(cfg);<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Now application is running perfectly fine from both eclipse<br>
&gt; and command<br>
&gt; prompt without any exception. <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; I want to know as my overrided method<br>
&gt; &quot;setCompiler&quot; was exactly<br>
&gt; same then why I had to override method, and In original<br>
&gt; code (ie in drools-compiler.jar<br>
&gt; file) why it was giving exception &nbsp;??? &nbsp;Was that<br>
&gt; due to class<br>
&gt; lader or something else ?? &nbsp;Please do help in this<br>
&gt; regard ....<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; &nbsp;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Thanks &amp; Regards:<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Pankaj Jain | L&amp;T infotech |Navi Mumbai<br>
&gt; <br>
&gt; Mobile: +91 9920218945<br>
&gt; <br>
&gt; Email : pankaj.jain@lntinfotech.com<br>
&gt; <br>
&gt; www.Lntinfotech.com<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; &quot;Whatever the mind of man can conceive &amp; believe,<br>
&gt; it can achieve.&quot;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Larsen &amp; Toubro Infotech Ltd.<br>
&gt; <br>
&gt; www.Lntinfotech.com<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; This Document is classified as: <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; L&amp;T<br>
&gt; Infotech Proprietary &nbsp; L&amp;T<br>
&gt; Infotech Confidential &nbsp; L&amp;T<br>
&gt; Infotech Internal Use Only &nbsp; L&amp;T<br>
&gt; Infotech General Business &nbsp; <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; This Email may contain confidential or privileged<br>
&gt; information for the intended<br>
&gt; recipient (s) If you are not the intended recipient, please<br>
&gt; do not use<br>
&gt; or disseminate the information, notify the sender and<br>
&gt; delete it from your<br>
&gt; system. <br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; ______________________________________________________________________<br>
&gt; <br>
&gt; <br>
&gt; -----Inline Attachment Follows-----<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; rules-users@lists.jboss.org<br>
&gt; https://lists.jboss.org/mailman/listinfo/rules-users<br>
&gt; <br>
<br>
<br>
 &nbsp; &nbsp; &nbsp;<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
https://lists.jboss.org/mailman/listinfo/rules-users<br>
<br>
______________________________________________________________________<br>
</font></tt>
<br>

<BR>
______________________________________________________________________<BR>