<div dir="ltr"><br> 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).<br>
<br> 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.<br>
<br> []s<br> Edson<br><br><div class="gmail_quote">2008/9/18 Soterro <span dir="ltr"><<a href="mailto:send_lotsa_spam_here@yahoo.com">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;">
Hi all,<br>
<br>
I have a perfectly running Eclipse 3.3 with DRools 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 which uses Janino (need it for Tomcat compatibility).<br>
Now OUTSIDE Eclipse it seems I cannot use that Ant task to save my life :(<br>
I tried switching from Janino to the default compiler, same thing. I always get this infamous error:<br>
<br>
BUILD FAILED<br>
E:\buildRules-hudson.xml:30: RuleBaseTask failed: Unable to load dialect<br>
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'<br>
at com.csc.ezbook.eztarif.rules.DroolsCompilerAntTaskStandalone.execute<br>
(DroolsCompilerAntTaskStandalone.java:163)<br>
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.<br>
java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(<br>
DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:585)<br>
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java<br>
:105)<br>
at org.apache.tools.ant.Task.perform(Task.java:348)<br>
[...]<br>
Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'<br>
at org.drools.compiler.PackageBuilderConfiguration.addDialect(<br>
PackageBuilderConfiguration.java:152)<br>
at org.drools.compiler.PackageBuilderConfiguration.<br>
buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)<br>
at org.drools.compiler.PackageBuilderConfiguration.init(<br>
PackageBuilderConfiguration.java:117)<br>
at org.drools.compiler.PackageBuilderConfiguration.<init>(<br>
PackageBuilderConfiguration.java:94)<br>
at com.my.app.rules.DroolsCompilerAntTaskStandalone.getPackageBuilder(<br>
DroolsCompilerAntTaskStandalone.java:257)<br>
at com.my.app.rules.DroolsCompilerAntTaskStandalone.execute(<br>
DroolsCompilerAntTaskStandalone.java:136)<br>
<br>
That "DroolsCompilerAntTaskStandalone" is my task using the default compiler like this:<br>
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();<br>
conf.setClassLoader( loader );<br>
PackageBuilder builder = new PackageBuilder( conf );<br>
<br>
If I use Janino like below the error is exactly the same...<br>
PackageBuilderConfiguration pkgBuilderCfg = new<br>
PackageBuilderConfiguration();<br>
pkgBuilderCfg.setClassLoader( loader );<br>
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)<br>
pkgBuilderCfg.getDialectConfiguration( "java" );<br>
javaConf.setCompiler( JavaDialectConfiguration.JANINO );<br>
PackageBuilder builder = new PackageBuilder( pkgBuilderCfg );<br>
<br>
Again, in Eclipse all is working fine. I checked Ant's classpath, here it is:<br>
E:\apache-ant-1.7.0\bin\..\lib\ant-launcher.jar<br>
E:\apache-ant-1.7.0\lib\*.jar<br>
C:\Program Files\Java\jdk1.5.0_14\lib\tools.jar<br>
<br>
Here is how I provide a classpath:<br>
<taskdef name="rulescompiler" classname="com.my.app.rules.<br>
DroolsCompilerAntTaskStandalone" classpathref="droolsutils.classpath" /><br>
<br>
<target depends="newfilesarethere" name="build" unless="rulesCompile.<br>
notRequired"><br>
<rulescompiler srcdir="${THIS_PROJ}/src/com/my/app/rules"<br>
tofile="${THIS_PROJ}/build/classes/com/my/app/rules/<br>
packaged.rules"<br>
classpathref="droolsutils.classpath" ><br>
<include name="*.drl" /><br>
</rulescompiler><br>
</target><br>
<br>
The classpath I provide contains pretty much all libraries I use normally in the project, but I tried even to add ALL jar's from the Eclipse 3.3 install directory (that would include all DRools 4.0.4 libraries, with antlr 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 it have issues with 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">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>
</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">www.jboss.com</a><br>
</div>