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