I noticed this when I was playing with some code last night. If I try to use the following from the doco

PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
javaConf.setCompiler( JavaDialectConfiguration.JANINO );

I get the error you are seeing when trying to instantiate a PackageBuilderConfiguration.

However if I use the following

Properties properties = new Properties();
properties.setProperty( "drools.dialect.java.compiler",
"JANINO" );
PackageBuilderConfiguration cfg = new PackageBuilderConfiguration( properties );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration) cfg.getDialectConfiguration( "java" );
assertEquals( JavaDialectConfiguration.JANINO,
javaConf.getCompiler() ); // demonstrate that the compiler is correctly configured

Janino seems to work ok. Looks like the default constructor for a PackageBuilderConfiguration needs to be able to locate the Eclipse JDT classes.

On 9/5/07, Garry Brother <gmbroth@hotmail.com> wrote:
Hi,

After two (unsuccessful) attempts at downloading and running
the drools examples, I'm ready to throw in the towel.  Before I
do that, however, I'm going to beg for help.

With ant, I was able to build the examples using the following
classpath:

   <path id="drools.jars" >
      <fileset dir="${drools.home}" >
          <include name="*.jar"/>
      </fileset>
    </path>

    <target name="compile">
      <mkdir dir="target"/>
      <mkdir dir="target/classes"/> 
     
      <copy todir="target/classes">
        <fileset dir="src/main/resources"/>
        <fileset dir="src/main/rules"/>
      </copy>                    
    
      <javac srcdir="src/main/java"
             destdir="target/classes"
             source="1.4">
        <classpath >
          <path refid="drools.jars" />           
          <fileset dir="lib">
            <include name="*.jar"/>
          </fileset>
        </classpath>
      </javac>                         
    </target> 

All attempts to run the "run-waltz12" example fail regardless
of what classes I throw at it.  I tried both "drools.jars"
above and the classpath below, without luck, as well as other
combinations of jars:

  <path id="jsr94.jars" >
    <fileset dir="${ drools.home}" >
        <include name="drools-core*.jar"/>
        <include name="drools-compiler*.jar"/>
        <include name="drools-jsr94.jar"/>
    </fileset>
    <fileset dir="${drools.home}/lib" >
        <include name="jsr94-1.1.jar"/>
        <include name="janino-2.5.7.jar"/>
    </fileset>
  </path>

Latest error is this:

     [java] Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath

I went out of my way to specify the janino jar so don't know
why an eclipse jar is required (I'm building from the command
line and not using Eclipse.)

I'm sure it's my ignorance but wonder if someone could email me
ant script that will do the job?

Thanks, Garry





Discover the new Windows Vista Learn more!

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users