<div dir="ltr"><br>&nbsp;&nbsp; Dependencies:<br><br><a href="https://svn.jboss.org/repos/labs/labs/jbossrules/branches/4.0.x/README_DEPENDENCIES.txt" target="_blank">https://svn.jboss.org/repos/labs/labs/jbossrules/branches/4.0.x/README_DEPENDENCIES.txt</a><br>

<br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><br><div class="gmail_quote">2008/9/22 Justin Case <span dir="ltr">&lt;<a href="mailto:send_lotsa_spam_here@yahoo.com" target="_blank">send_lotsa_spam_here@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Thanks a lot for the answer. The problem is exactly that one: how could I know what the dependencies for the DRools compiler are?! I thought this list would know :)) Anyway, I&#39;ll print out the Eclipse runtime classpath and compare them two to see what stands out.<br>


<br>
The Ant task is mentioned here and there in the documentation (albeit without examples) so I kinda thought more people are using it. An older thread of this same list talks about adding (only) the drools-ant to the classpath, which of course solves the ant task itself but none of its dependencies... I find it difficult to believe that the compiler depends on some Eclipse stuff, especially after I added ALL the jars existing in the Eclipse configuration. The only thing I cannot directly rule out is the classloader issue, but that&#39;s also the only thing I have no idea how to debug/solve :(<br>


<br>
Thank you,<br>
M<br>
<div><div></div><div><br>
--- On Sun, 9/21/08, Edson Tirelli &lt;<a href="mailto:tirelli@post.com" target="_blank">tirelli@post.com</a>&gt; wrote:<br>
&gt; This is always related to classpath problems. Make sure you have all<br>
&gt; dependencies set in your classpath and if that does not work, maybe<br>
&gt; make an&gt; example project with the error available somewhere that<br>
&gt; another person can take a look at it. (don&#39;t think you can send zip<br>
&gt; attachements to the list, but not sure).<br>
&gt;<br>
&gt; &nbsp; &nbsp;Eclipse-plugin embeds a series of dependency jars that are<br>
&gt; transparently added to the classpath. That is the major reason you may<br>
&gt; see the problem outside of eclipse, but not inside. Classloader<br>
&gt; configuration is also another reason.<br>
&gt;<br>
&gt; &nbsp; &nbsp;[]s<br>
&gt; &nbsp; &nbsp;Edson<br>
&gt;<br>
&gt; 2008/9/18 Soterro &lt;<a href="mailto:send_lotsa_spam_here@yahoo.com" target="_blank">send_lotsa_spam_here@yahoo.com</a>&gt;<br>
&gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; I have a perfectly running Eclipse 3.3 with DRools<br>
&gt; 4.0.4 and JDK <a href="http://1.5.14." target="_blank">1.5.14.</a><br>
&gt; &gt; The rules are compiled with a post build Ant task<br>
&gt; which uses Janino (need<br>
&gt; &gt; it for Tomcat compatibility).<br>
&gt; &gt; Now OUTSIDE Eclipse it seems I cannot use that Ant<br>
&gt; task to save my life :(<br>
&gt; &gt; I tried switching from Janino to the default compiler,<br>
&gt; same thing. I always<br>
&gt; &gt; get this infamous error:<br>
&gt; &gt;<br>
&gt; &gt; &nbsp;BUILD FAILED<br>
&gt; &gt; &nbsp;E:\buildRules-hudson.xml:30: RuleBaseTask failed:<br>
&gt; Unable to load dialect<br>
&gt; &gt;<br>
&gt; &#39;org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java&#39;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; &gt;<br>
&gt; com.csc.ezbook.eztarif.rules.DroolsCompilerAntTaskStandalone.execute<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;(DroolsCompilerAntTaskStandalone.java:163)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; &gt;<br>
&gt; org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; &gt;<br>
&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;java:39)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;DelegatingMethodAccessorImpl.java:25)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; java.lang.reflect.Method.invoke(Method.java:585)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; &gt;<br>
&gt; org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;:105)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; org.apache.tools.ant.Task.perform(Task.java:348)<br>
&gt; &gt; &nbsp;[...]<br>
&gt; &gt; &nbsp;Caused by: org.drools.RuntimeDroolsException: Unable<br>
&gt; to load dialect<br>
&gt; &gt;<br>
&gt; &#39;org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java&#39;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.addDialect(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;PackageBuilderConfiguration.java:152)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.<br>
&gt; &gt;<br>
&gt; buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.init(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;PackageBuilderConfiguration.java:117)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; org.drools.compiler.PackageBuilderConfiguration.&lt;init&gt;(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;PackageBuilderConfiguration.java:94)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; &gt;<br>
&gt; com.my.app.rules.DroolsCompilerAntTaskStandalone.getPackageBuilder(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;DroolsCompilerAntTaskStandalone.java:257)<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt; com.my.app.rules.DroolsCompilerAntTaskStandalone.execute(<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;DroolsCompilerAntTaskStandalone.java:136)<br>
&gt; &gt;<br>
&gt; &gt; That &quot;DroolsCompilerAntTaskStandalone&quot; is my<br>
&gt; task using the default<br>
&gt; &gt; compiler like this:<br>
&gt; &gt; &nbsp; &nbsp;PackageBuilderConfiguration conf = new<br>
&gt; PackageBuilderConfiguration();<br>
&gt; &gt; &nbsp; &nbsp;conf.setClassLoader( loader );<br>
&gt; &gt; &nbsp; &nbsp;PackageBuilder builder = new PackageBuilder( conf<br>
&gt; );<br>
&gt; &gt;<br>
&gt; &gt; If I use Janino like below the error is exactly the<br>
&gt; same...<br>
&gt; &gt; &nbsp; &nbsp;PackageBuilderConfiguration pkgBuilderCfg = new<br>
&gt; &gt; &nbsp; &nbsp;PackageBuilderConfiguration();<br>
&gt; &gt; &nbsp; &nbsp;pkgBuilderCfg.setClassLoader( loader );<br>
&gt; &gt; &nbsp; &nbsp;JavaDialectConfiguration javaConf =<br>
&gt; (JavaDialectConfiguration)<br>
&gt; &gt; &nbsp; &nbsp;pkgBuilderCfg.getDialectConfiguration(<br>
&gt; &quot;java&quot; );<br>
&gt; &gt; &nbsp; &nbsp;javaConf.setCompiler(<br>
&gt; JavaDialectConfiguration.JANINO );<br>
&gt; &gt; &nbsp; &nbsp;PackageBuilder builder = new PackageBuilder(<br>
&gt; pkgBuilderCfg );<br>
&gt; &gt;<br>
&gt; &gt; Again, in Eclipse all is working fine. I checked<br>
&gt; Ant&#39;s classpath, here it<br>
&gt; &gt; is:<br>
&gt; &gt;<br>
&gt; E:\apache-ant-1.7.0\bin\..\lib\ant-launcher.jar<br>
&gt; &gt; &nbsp;E:\apache-ant-1.7.0\lib\*.jar<br>
&gt; &gt; &nbsp;C:\Program<br>
&gt; Files\Java\jdk1.5.0_14\lib\tools.jar<br>
&gt; &gt;<br>
&gt; &gt; Here is how I provide a classpath:<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;taskdef name=&quot;rulescompiler&quot;<br>
&gt; classname=&quot;com.my.app.rules.<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;DroolsCompilerAntTaskStandalone&quot;<br>
&gt; &gt; classpathref=&quot;droolsutils.classpath&quot; /&gt;<br>
&gt; &gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;target depends=&quot;newfilesarethere&quot;<br>
&gt; name=&quot;build&quot;<br>
&gt; &gt; unless=&quot;rulesCompile.<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;notRequired&quot;&gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;rulescompiler<br>
&gt; srcdir=&quot;${THIS_PROJ}/src/com/my/app/rules&quot;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; tofile=&quot;${THIS_PROJ}/build/classes/com/my/app/rules/<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; packaged.rules&quot;<br>
&gt; &gt;<br>
&gt; classpathref=&quot;droolsutils.classpath&quot; &gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;include name=&quot;*.drl&quot;<br>
&gt; /&gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/rulescompiler&gt;<br>
&gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/target&gt;<br>
&gt; &gt;<br>
&gt; &gt; The classpath I provide contains pretty much all<br>
&gt; libraries I use normally<br>
&gt; &gt; in the project, but I tried even to add ALL jar&#39;s<br>
&gt; from the Eclipse 3.3<br>
&gt; &gt; install directory (that would include all DRools 4.0.4<br>
&gt; libraries, with antlr<br>
&gt; &gt; and whatnot)<br>
&gt; &gt;<br>
&gt; &gt; I tried also with DRools 4.0.7, same behaviour...<br>
&gt; &gt;<br>
&gt; &gt; What does that mean and where is it coming from? Could<br>
&gt; it have issues with<br>
&gt; &gt; the tools.jar from Java 1.5.0_14?<br>
&gt; &gt;<br>
&gt; &gt; Thank you for any input,<br>
&gt; &gt; M<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; rules-users mailing list<br>
&gt; &gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Edson Tirelli<br>
&gt; JBoss Drools Core Development<br>
&gt; JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div>