Hello,

I try to run this source code, but I get  this ugly error which I don't know to deal with: Exception in thread "main" java.lang.NoClassDefFoundError:
                                org/apache/commons/jci/compilers/JavaCompiler

Please give me some hints to resolve this issue.The cause seems to be this line of code:   PackageBuilder builder = new PackageBuilder( conf );

PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
        conf.setCompiler( PackageBuilderConfiguration.JANINO );
        //conf.setCompiler( PackageBuilderConfiguration.ECLIPSE);
        conf.setJavaLanguageLevel( "1.5" );   
        PackageBuilder builder = new PackageBuilder( conf );
       
        builder.addPackageFromDrl( new InputStreamReader( JBossRulesExample.class.getResourceAsStream( "JBossRuleExample.drl" ) ) );

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        ruleBase.addPackage( builder.getPackage() );

        final WorkingMemory workingMemory = ruleBase.newWorkingMemory();           

        final WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger(
                                                                                         workingMemory );
        logger.setFileName( "log/jbossrulesexample" );
           
            final Employed e1 = j.new Employed("Fred",10,5);
            final Employed e2 = j.new Employed("Susan",12,6);
           
            final FactHandle f1 = workingMemory.assertObject( e1 );
            final FactHandle f2 = workingMemory.assertObject( e2 );
           
            workingMemory.fireAllRules();
            e1.setExtraHours(2);
            workingMemory.modifyObject(f1,e1);
           
    }

All the best,
              Oana


Want to start your own business? Learn how on Yahoo! Small Business.

Reply via email to