Hi,

I have {Rule1.drl,Rule2,drl,Rule3.brl}

Both the .drl rules run correctly but the .brl does not load and gives me the following error

Exception in thread "main" org.drools.rule.InvalidRulePackage: [1,0]: unknown:1:0 mismatched token: [@0,0:0='<',<79>,1:0];

      at org.drools.rule.Package.checkValidity(Package.java:424)

      at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:394)

      at com.org.RuleRunner.loadRules(RuleRunner.java:45)        

      at com.org.RuleRunner.runStatelessRules(RuleRunner.java:79)

      at com.org.RulesTest.main(RulesTest.java:40)

 

I am loading my rules as follows:

 

    private RuleBase loadRules(String[]  rules) throws Exception{

   

          PackageBuilder builder = new PackageBuilder();

         

          for ( int i = 0; i < rules.length; i++ ) {

              String rulesFiles = rules[i];

              //Check the type of rule file, then load it

              System.out.println("loading rule file : "+rulesFiles);

              loadRuleFile(rulesFiles,builder);

             

          }

          Package pkg = builder.getPackage();

          RuleBase localRuleBase = RuleBaseFactory.newRuleBase();

          localRuleBase.addPackage( pkg );   

        

          return localRuleBase;

    }

 

    private void loadRuleFile(String rulesFiles,PackageBuilder addRulesToThisPackage ) throws DroolsParserException, IOException{

        Reader source = new InputStreamReader( RuleRunner.class.getResourceAsStream(rulesFiles) );

        //Load the rules , no DSL

        addRulesToThisPackage.addPackageFromDrl(source); // is this wrong??? Is there another method that I should       

                                                            be using???

       

       

    }

The above code is where I get the error.

Is there some other way to load .brl and .drl files?? We cannot do it together??

I could not find any help on;line on loading and running .brl files.

 

Please help.

Thank you.

M

 

 

 




Please consider the environment before printing this email.

Visit our website at http://www.nyse.com
*****************************************************************************
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.