Re: [rules-users] Rule Validation/Package Build Error in Guvnor: ClassNot Found
Hi, your (b) problem looks like compatibility problems between guvnor version and drools-core version used by your knowledge agent. Which versions are you using? Best, On Thu, Jul 1, 2010 at 2:18 AM, Ike iok...@gmail.com wrote: Jeff Can't thank you enough. The explanation you gave cleared a number of cobwebs. I got all the jars in and do not get anymore class errors however I encountered two more issues (1) Some of the rules validate succesfully within guvnor but I have a couple of rules that use maps on which I am getting errors. The map contains objects of a certain type Class1 and the map key is a Long (e.g 1L, 2L). The statement causing the error is of the format eval(Map[1L].getDirection== Map [2L].getDirection). The error I get is unqualified type in strict mode for getDirection. I scoured the forums for a solution and learnt that I need to cast the object from the map to its specific type before calling any method of the class and so I changed it to eval(((Class1)Map[2L]).getDirection == ((Class1)Map[3L]).getDirection) but the errors only got worse. Is there a resolution for this unqualified type in strict mode error? I should also mention that I get no such error when working with the .DRL file in my java code outside guvnor. (b) The second issue I am dealing with involves those rules that validated in guvnor (I am running guvnor under JBOSS 4.2.3). I validated and built the package successfully (I did not create a snapshot for deployment). I then tried to reference the guvnor package to build the rulebase using the following java code RuleAgent agent = RuleAgent.newRuleAgent(guvnor.properties); RuleBase masterRuleBase = agent.getRuleBase(); guvnor.properties contains only one entry url = http://localhost:8080/drools- guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST I got this url from the guvnor deployment page The error I got when I ran this was java.io.InvalidCastException: org.drools.rule.DialectRuntimeRegistry; local class incompatible: stream classdesc serailVersionUID= 5308493362083281112, local class serialVersionID = 510 Is there a compatibility issue between Guvnor and JBOSS 4.2.3 Thanks ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users -- Esteban Aliverti ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Validation/Package Build Error in Gu vnor: ClassNot Found
Jeff Can't thank you enough. The explanation you gave cleared a number of cobwebs. I got all the jars in and do not get anymore class errors however I encountered two more issues (1) Some of the rules validate succesfully within guvnor but I have a couple of rules that use maps on which I am getting errors. The map contains objects of a certain type Class1 and the map key is a Long (e.g 1L, 2L). The statement causing the error is of the format eval(Map[1L].getDirection== Map [2L].getDirection). The error I get is unqualified type in strict mode for getDirection. I scoured the forums for a solution and learnt that I need to cast the object from the map to its specific type before calling any method of the class and so I changed it to eval(((Class1)Map[2L]).getDirection == ((Class1)Map[3L]).getDirection) but the errors only got worse. Is there a resolution for this unqualified type in strict mode error? I should also mention that I get no such error when working with the .DRL file in my java code outside guvnor. (b) The second issue I am dealing with involves those rules that validated in guvnor (I am running guvnor under JBOSS 4.2.3). I validated and built the package successfully (I did not create a snapshot for deployment). I then tried to reference the guvnor package to build the rulebase using the following java code RuleAgent agent = RuleAgent.newRuleAgent(guvnor.properties); RuleBase masterRuleBase = agent.getRuleBase(); guvnor.properties contains only one entry url = http://localhost:8080/drools- guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST I got this url from the guvnor deployment page The error I got when I ran this was java.io.InvalidCastException: org.drools.rule.DialectRuntimeRegistry; local class incompatible: stream classdesc serailVersionUID= 5308493362083281112, local class serialVersionID = 510 Is there a compatibility issue between Guvnor and JBOSS 4.2.3 Thanks ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Rule Validation/Package Build Error in Guvnor: Class Not Found
Hello, I am new to Drools and have written a rule .DRL file which contains some helper function imports from other packages, fact objects imports from other packages and the rules that act on these facts. The file works well when I call it from my javacode using the rulebase or knowledgebase approach. The drl file itself is in its own package. I now have a requirement to call the same rules from within Guvnor. The goal is to enable business users modify these rules through the Guvnor UI and also take advantage of the disable individual rules feature within guvnor. My current difficulty is importing and validating the rules in guvnor, along with the associated fact jar files and finally interfacing with guvnor from my code. Any help would be appreciated . The main error happens when I try to build a binary package and create a snapshot of the working rule file I imported for deployment. When I hit the save and validate configuration button, I get *class not found* validation errors for all the classes imported at the top of the rule file - includingng the helper import functions and facts used in the rules. Same thing happens when I try to build the package I get the following errors Error importing: list of all classes in import statement in rule file Here are the steps I followed in importing the rule file and Jar file containing the classes into Guvnor (1) First within Guvnor I created a package corresponding to the package path for for each of the jar files whose classes are referenced/imported in the rule .DRL file (2) I created the jar files for each of these packages in eclipse (3) Imported those jars individually into each of the packages created in guvnor using upload model jar function and selecting the appropriate path as created in step 1 2 above (4) Imported the rule file which is in its own package - using the create package (upload method) (5) I then try to save and validate the imported rule file in step 5 (this is where the error occurs) I have already setup my code to call guvnor as follows RuleAgent agent = RuleAgent.newRuleAgent(guvnor.properties); RuleBase masterRuleBase = agent.getRuleBase(); guvnor.properties contains only one entry url = http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST It is my understanding that after I import the rule file I need to save and validate and build the package in order to point the url to the path above. If I point the url to just the drl file itself will it work? i.e url= http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/SomePackage.drools/LATEST.drl Any help to resolve the class not found error will be much appreciated Thanks ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Rule Validation/Package Build Error in Guvnor: ClassNot Found
Your jar files [the models] need to be in the same drools package as your DRL file. So if in the Guvnor you have: com.domain.project.rules Business Rules Your DRL file Then you need to have the model in the same package. com.domain.project.rules Business Rules Your DRL file Models Jar 1 Jar 2 Jar 3 The objects in each jar don't have to be in the com.domain.project.rules package. They can be in any package. You do need to import the correct objects in your DRL however. The package you specify in the Guvnor is the package that the individual rules get compiled into. From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ike Okafo Sent: Monday, June 28, 2010 4:32 PM To: rules-users@lists.jboss.org Subject: [rules-users] Rule Validation/Package Build Error in Guvnor: ClassNot Found Hello, I am new to Drools and have written a rule .DRL file which contains some helper function imports from other packages, fact objects imports from other packages and the rules that act on these facts. The file works well when I call it from my javacode using the rulebase or knowledgebase approach. The drl file itself is in its own package. I now have a requirement to call the same rules from within Guvnor. The goal is to enable business users modify these rules through the Guvnor UI and also take advantage of the disable individual rules feature within guvnor. My current difficulty is importing and validating the rules in guvnor, along with the associated fact jar files and finally interfacing with guvnor from my code. Any help would be appreciated . The main error happens when I try to build a binary package and create a snapshot of the working rule file I imported for deployment. When I hit the save and validate configuration button, I get class not found validation errors for all the classes imported at the top of the rule file - includingng the helper import functions and facts used in the rules. Same thing happens when I try to build the package I get the following errors Error importing: list of all classes in import statement in rule file Here are the steps I followed in importing the rule file and Jar file containing the classes into Guvnor (1) First within Guvnor I created a package corresponding to the package path for for each of the jar files whose classes are referenced/imported in the rule .DRL file (2) I created the jar files for each of these packages in eclipse (3) Imported those jars individually into each of the packages created in guvnor using upload model jar function and selecting the appropriate path as created in step 1 2 above (4) Imported the rule file which is in its own package - using the create package (upload method) (5) I then try to save and validate the imported rule file in step 5 (this is where the error occurs) I have already setup my code to call guvnor as follows RuleAgent agent = RuleAgent.newRuleAgent(guvnor.properties); RuleBase masterRuleBase = agent.getRuleBase(); guvnor.properties contains only one entry url = http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Som ePackage.drools/LATEST It is my understanding that after I import the rule file I need to save and validate and build the package in order to point the url to the path above. If I point the url to just the drl file itself will it work? i.e url=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package /SomePackage.drools/LATEST.drl Any help to resolve the class not found error will be much appreciated Thanks ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] rule validation
Hi, I have some rules written in a dsl in a data base and I need to validate those rule so I used a PackageBuilder instance and a PackageBuilderErrors but it's a bit akward to manage with the subclasses of DroolsError. What I need is to get the line number of the error in my drl file (the DroolsError ). How can I proceed ? thanks This is what I tried to do : PackageBuilderErrors pkgBuilderErrors = builder.getErrors(); DroolsError[] droolsErrors = pkgBuilderErrors.getErrors(); ListDroolsError errorList = new ArrayListDroolsError(Arrays.asList(droolsErrors)); for (DroolsError droolsError : errorList) { if (droolsError instanceof ParserError) { ... -- View this message in context: http://www.nabble.com/rule-validation-tf4268341.html#a12147869 Sent from the drools - user mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users