----- Original Message -----From: Mark ProctorTo: Rules Users ListSent: Monday, September 22, 2008 12:56 PMSubject: Re: [rules-users] Unable to load dialect java from Ant taskthe only Eclipe jar drools depends on is Eclipse JDT Compiler, which is available separately and is up on ibiblio.
Justin Case wrote: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. 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 :( Thank you, M --- On Sun, 9/21/08, Edson Tirelli <tirelli@post.com> wrote:This is always related to classpath problems. Make sure you have all dependencies set in your classpath and if that does not work, maybe make an> example project with the error available somewhere that another person can take a look at it. (don't think you can send zip attachements to the list, but not sure). Eclipse-plugin embeds a series of dependency jars that are transparently added to the classpath. That is the major reason you may see the problem outside of eclipse, but not inside. Classloader configuration is also another reason. []s Edson 2008/9/18 Soterro <send_lotsa_spam_here@yahoo.com>Hi all, I have a perfectly running Eclipse 3.3 with DRools4.0.4 and JDK 1.5.14.The rules are compiled with a post build Ant taskwhich uses Janino (needit for Tomcat compatibility). Now OUTSIDE Eclipse it seems I cannot use that Anttask to save my life :(I tried switching from Janino to the default compiler,same thing. I alwaysget this infamous error: BUILD FAILED E:\buildRules-hudson.xml:30: RuleBaseTask failed:Unable to load dialect'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'atcom.csc.ezbook.eztarif.rules.DroolsCompilerAntTaskStandalone.execute(DroolsCompilerAntTaskStandalone.java:163) atorg.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)atsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) atjava.lang.reflect.Method.invoke(Method.java:585)atorg.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) atorg.apache.tools.ant.Task.perform(Task.java:348)[...] Caused by: org.drools.RuntimeDroolsException: Unableto load dialect'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'atorg.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:152) atorg.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)atorg.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:117) atorg.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:94) atcom.my.app.rules.DroolsCompilerAntTaskStandalone.getPackageBuilder(DroolsCompilerAntTaskStandalone.java:257) atcom.my.app.rules.DroolsCompilerAntTaskStandalone.execute(DroolsCompilerAntTaskStandalone.java:136) That "DroolsCompilerAntTaskStandalone" is mytask using the defaultcompiler like this: PackageBuilderConfiguration conf = newPackageBuilderConfiguration();conf.setClassLoader( loader ); PackageBuilder builder = new PackageBuilder( conf);If I use Janino like below the error is exactly thesame...PackageBuilderConfiguration pkgBuilderCfg = new PackageBuilderConfiguration(); pkgBuilderCfg.setClassLoader( loader ); JavaDialectConfiguration javaConf =(JavaDialectConfiguration)pkgBuilderCfg.getDialectConfiguration("java" );javaConf.setCompiler(JavaDialectConfiguration.JANINO );PackageBuilder builder = new PackageBuilder(pkgBuilderCfg );Again, in Eclipse all is working fine. I checkedAnt's classpath, here itis:E:\apache-ant-1.7.0\bin\..\lib\ant-launcher.jarE:\apache-ant-1.7.0\lib\*.jar C:\ProgramFiles\Java\jdk1.5.0_14\lib\tools.jarHere is how I provide a classpath: <taskdef name="rulescompiler"classname="com.my.app.rules.DroolsCompilerAntTaskStandalone" classpathref="droolsutils.classpath" /> <target depends="newfilesarethere"name="build"unless="rulesCompile. notRequired"> <rulescompilersrcdir="${THIS_PROJ}/src/com/my/app/rules"tofile="${THIS_PROJ}/build/classes/com/my/app/rules/packaged.rules"classpathref="droolsutils.classpath" ><include name="*.drl"/></rulescompiler> </target> The classpath I provide contains pretty much alllibraries I use normallyin the project, but I tried even to add ALL jar'sfrom the Eclipse 3.3install directory (that would include all DRools 4.0.4libraries, with antlrand whatnot) I tried also with DRools 4.0.7, same behaviour... What does that mean and where is it coming from? Couldit have issues withthe tools.jar from Java 1.5.0_14? Thank you for any input, M _______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users-- Edson Tirelli JBoss Drools Core Development JBoss, a division of Red Hat @ www.jboss.com_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users