Re: [rules-users] Automatic PDF rule documentation does not include dsl based business rules
Oh, I'm sorry, I forgot to mention that the version I use is Guvnor 5.3 Final. I guess the example is also available for 5.3, so I will test it as you did. -- View this message in context: http://drools.46999.n3.nabble.com/Automatic-PDF-rule-documentation-does-not-include-dsl-based-business-rules-tp3954720p3954903.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Automatic PDF rule documentation does not include dsl based business rules
Now that I have tested my guvnor config with the mortgages example too, the documentation shows all twelve example rules in the pdf. So there has to be something wrong with my package config. One difference is that my package does not only contain one dsl asset but two, but that shouldn't matter, should it? -- View this message in context: http://drools.46999.n3.nabble.com/Automatic-PDF-rule-documentation-does-not-include-dsl-based-business-rules-tp3954720p3954934.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Automatic PDF rule documentation does not include dsl based business rules
To isolate the problem I started with an empty package and copying only the necessary assets (the two dsls, businessModel). Then I also copied a business rule which uses the two dsls. This rule did not appear in the doc. (the rule type is DSL business rule text editor) Then I created a new and empty business rule of the type Business Rule guided editor. This rule showed up in the doc. At last I created a new and empty business rule of the type DSL business rule text editor. Same as the first rule I copied, that one also does not show up in the pdf doc. Is there anything special to configure for the according two dsl files? When examining the drools source code, where should I take a first look? -- View this message in context: http://drools.46999.n3.nabble.com/Automatic-PDF-rule-documentation-does-not-include-dsl-based-business-rules-tp3954720p3954993.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] org.drools.compiler.DroolsParserException while adding Package from DRL
I was able to resolve the issue mentioned above by adding the follwoing line to the VM arguments of my Eclipse Server Run Configuration for both, the Tomcat for the Drools Engine as well as the Tomcat for the Guvnor: -Dfile.encoding=UTF-8 (Added to: Package Explorer Servers Run As Run Configurations Apache Tomcat Arguments VM arguments) To me it seems that the package parser needs to be modified so that it is able to detect wether the package is encoded with the correct character charset (UTF-8) before parsing - in other words catching an encoding exception. Otherwise the parser is confronted with tons of characters its grammar isn't designed for and will crash (silently) leading to the strange behaviour I already described in the error post. -- View this message in context: http://drools.46999.n3.nabble.com/org-drools-compiler-DroolsParserException-while-adding-Package-from-DRL-tp3527243p3535529.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] org.drools.compiler.DroolsParserException while adding Package from DRL
Hello, let me give you some context at first: I'm trying to update my drools engine and guvnor from 5.1M1 to 5.3Final. I exported my existing rules package via Guvnor 5.1 GUI into xml and imported it back into a fresh Guvnor 5.3. The package content looks fine in Guvnor and a package binary can be built successfully. Now something strange happens: 5.1 engine - 5.1 guvnor -- works fine 5.1 engine - 5.3 guvnor -- works fine 5.3 engine - 5.3 guvnor -- fail (5.3 engine - 5.1 guvnor -- not tested yet) Let's assume the case 5.3 engine - 5.3 guvnor: At first all I got was an unexpected global exception -- the globals aren't added to the rulebase while reading the package. So the system is right throwing that exception. But why aren't they added? I figured out that there were millions of errors while parsing the URL rule package from DRL. So many errors, that the parser itself gets into an unhandled state and throws the exception mentioned below. To mention that: I retried the same scenario with an empty package, even without any fact model inserted but got the same error while parsing the package during creation of a knowledge session. My questions is: Why does the old 5.1 engine just do well with the package from the new 5.3 Guvnor while the new 5.3 engine fails? As I see it, the binary package creation by the guvnor has to be correct otherwise the old engine would fail too. I appreciate any help on resolving if there is anything wrong on my side or if it is a real error in the parser code as the exception intends. Thank you! url: http://127.0.0.1:8181/drools-guvnor/rest/packages/defaultPackage/binary java.lang.IndexOutOfBoundsException: Index: 23, Size: 23 at java.util.ArrayList.RangeCheck(Unknown Source) at java.util.ArrayList.get(Unknown Source) at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:103) at org.drools.lang.ParserHelper.reportError(ParserHelper.java:386) at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:182) at org.drools.compiler.DrlParser.compile(DrlParser.java:225) at org.drools.compiler.DrlParser.parse(DrlParser.java:136) at org.drools.compiler.DrlParser.parse(DrlParser.java:141) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37) at de.tiq.rules.drools.DrlUrlRuleResource.getKnowledgePackages(DrlUrlRuleResource.java:77) at de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:264) at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95) at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178) at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546) ERROR JobRunShell - Job TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an unhandled Exception: java.lang.RuntimeException: org.drools.compiler.DroolsParserException: Unexpected exception raised while parsing. This is a bug. Please contact the Development team : Index: 23, Size: 23 at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37) at de.tiq.rules.drools.DrlUrlRuleResource.getKnowledgePackages(DrlUrlRuleResource.java:77) at de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:264) at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95) at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178) at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546) Caused by: org.drools.compiler.DroolsParserException: Unexpected exception raised while parsing. This is a bug. Please contact the Development team : Index: 23, Size: 23 at org.drools.compiler.DrlParser.compile(DrlParser.java:242) at org.drools.compiler.DrlParser.parse(DrlParser.java:136) at org.drools.compiler.DrlParser.parse(DrlParser.java:141) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586) ... 8 more ERROR ErrorLogger - Job (TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.RuntimeException: org.drools.compiler.DroolsParserException: Unexpected exception raised while parsing. This is a bug. Please
Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration
Thank you so much Thomas! There indeed was an old 5.1 jar in another subproject left on the classpath. -- View this message in context: http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3499642.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration
*push* -- View this message in context: http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3499019.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration
Hello everyone, I'm struggling with the following error after updating from Drools 5.1M1 to 5.3Final when handing over a URLClassloader as a parameter for RuleBaseConfiguration. The URL of the classLoader points to Jar file containing the facts. ERROR JobRunShell - Job TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an unhandled Exception: java.lang.NoSuchMethodError: org.drools.RuleBaseConfiguration.init([Ljava/lang/ClassLoader;)V at de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:263) at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95) at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178) at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546) ERROR ErrorLogger - Job (TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an exception. org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoSuchMethodError: org.drools.RuleBaseConfiguration.init([Ljava/lang/ClassLoader;)V] at org.quartz.core.JobRunShell.run(JobRunShell.java:210) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546) Caused by: java.lang.NoSuchMethodError: org.drools.RuleBaseConfiguration.init([Ljava/lang/ClassLoader;)V at de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:263) at de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95) at de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178) at de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173) at org.quartz.core.JobRunShell.run(JobRunShell.java:199) This is the part of the code where the ClassLoader is given as a parameter: /** * create a knowledge base of a given rule resource * * @param ruleResource *the rule resource * @return the created knowledge base */ private KnowledgeBase createKnowledgeBase(IRuleResource ruleResource) { if (ruleResource == null) { throw new NullPointerException(ruleResource is null); } KnowledgeBase kbase; ClassLoader[] arrayOfClassLoaders = new ClassLoader[1]; arrayOfClassLoaders[0] = currProject.getFactsClassLoader(); final KnowledgeBaseConfiguration kbaseconfig = new RuleBaseConfiguration(currProject.getFactsClassLoader()); kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseconfig); kbase.addKnowledgePackages(ruleResource.getKnowledgePackages(kbase)); return kbase; } This is what getFactsClassLoader does: public ClassLoader getFactsClassLoader() { try { if (factsClassLoader == null) { URL jarURL; jarURL = getExecuteJarFile().toURI().toURL(); factsClassLoader = new URLClassLoader(new URL[] { jarURL }, Thread.currentThread() .getContextClassLoader()); } return factsClassLoader; } catch (final MalformedURLException e) { throw new RuntimeException(e); } } Thx in advance for any hint on solving the mentioned problem! -- View this message in context: http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3489741.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users