Re: [rules-users] java dialect and declared types
I've tried to reproduce this in a tester but all my unit tests show 6.0.0 marginally quicker. The rules and data are simplified for the test so I'll try something closer to what i am seeing on the full system. I've just done another comparison and the results are shown in the attached image. http://drools.46999.n3.nabble.com/file/n4027884/Screenshot_2.png There are a number of spikes in the 6.0.1 run that don't help, but it is clear that the 5.5.0 execution is better. I've run the tests several times and all show the same thing. 1st col is average time - 250 jobs to process 2nd col is total time for test to complete - 10 processes executing - 48 core machine 4gb per process - mvel dialect For 5.5.0 5854215 5707193 5629189 5512183 5607189 5395183 5369183 For 6.0.0 6229244 5828219 6076223 5767220 5735220 5821214 -- View this message in context: http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027884.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] Drools as osgi bundle in Jboss AS
Hi, I am trying to run Hello World using drools as osgi bundle in Jboss AS. Deployed below jars to Jboss container : drools-compiler-6.0.0.Beta1.jar drools-core-6.0.0.Beta1.jar drools-templates-6.0.0.Beta1.jar kie-api-6.0.0.Beta1.jar kie-internal-6.0.0.beta1.jar While deploying my own bundle to Jboss which has Hello World Drools application, I get below exception: Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration' at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:321) at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192) at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:170) at org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:22) at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:74) at org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:80) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ... 34 more Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:100) at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:61) at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:317) ... 42 more Then added org.eclipse.jdt.core_3.8.3.v20130121-145325.jar to classpath of OSGI bundle (Hello World Bundle) and deployed again. Above exception has got resolved, but application is not working. Code below : public void start(){ logger.info(started.); System.out.println(Hello World in client!! ); //droolsSession = createKnowledgeSession(); MessageTest message = new MessageTest(); message.setMessage(Testing Hello World); message.setStatus(MessageTest.HELLO); droolsSession.insert(message); droolsSession.fireAllRules(); } @SuppressWarnings(deprecation) private StatefulKnowledgeSession createKnowledgeSession() { System.out.println(Inside createKnowledgeSession!! ); KnowledgeBuilderFactoryServiceImpl knowledgeBuilderFactoryServiceImpl = new KnowledgeBuilderFactoryServiceImpl(); KnowledgeBuilder kbuilder = knowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(); kbuilder.add((Resource) new ClassPathResource(Sample.drl), ResourceType.DRL); System.out.println(Completed createKnowledgeSession!! ); if (kbuilder.hasErrors()) { if (kbuilder.getErrors().size() 0) { for (KnowledgeBuilderError kerror : kbuilder.getErrors()) { System.err.println(kerror); } } } KnowledgeBase kbase = kbuilder.newKnowledgeBase(); return kbase.newStatefulKnowledgeSession(); //return kbase.newStatefulKnowledgeSession(); } -- View this message in context: http://drools.46999.n3.nabble.com/Drools-as-osgi-bundle-in-Jboss-AS-tp4027885.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] Null pointer exception when using global in rdrl 6.0.1.F
Thanks! -- View this message in context: http://drools.46999.n3.nabble.com/Null-pointer-exception-when-using-global-in-rdrl-6-0-1-F-tp4027876p4027886.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] Null Pointer Exception with 10K+ kBase objects
Could you post the full test case (rules + java)? Thanks Davide On 01/28/2014 05:10 PM, jhusby wrote: I'm trying to stress-test Drools to see what its limits are, and I stumbled across a NPE when I have a large amount of facts in a stateful knowledgebase: java.lang.NullPointerException at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuple(PhreakTimerNode.java:355) at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuples(PhreakTimerNode.java:325) at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:72) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:357) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116) at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:200) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:67) at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935) at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:957) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:931) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:256) I have a little program that creates, populates, fires, and destroys a session repeatedly. With 10K objects in the knowledge base, I get the NPE the first time I loop through my program, but not subsequently (probably because by the subsequent executions things have been cached). With 100K objects, I get the exception most times. With 1M objects, I get the NPE every time. Am I doing anything wrong or is it simply taking so long to execute all the rules that something times out? Is there a timeout param I could set? Thank you! Joseph -- View this message in context: http://drools.46999.n3.nabble.com/Null-Pointer-Exception-with-10K-kBase-objects-tp4027887.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Null Pointer Exception with 10K+ kBase objects
I'm trying to stress-test Drools to see what its limits are, and I stumbled across a NPE when I have a large amount of facts in a stateful knowledgebase: java.lang.NullPointerException at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuple(PhreakTimerNode.java:355) at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuples(PhreakTimerNode.java:325) at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:72) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:357) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116) at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:200) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:67) at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935) at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:957) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:931) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:256) I have a little program that creates, populates, fires, and destroys a session repeatedly. With 10K objects in the knowledge base, I get the NPE the first time I loop through my program, but not subsequently (probably because by the subsequent executions things have been cached). With 100K objects, I get the exception most times. With 1M objects, I get the NPE every time. Am I doing anything wrong or is it simply taking so long to execute all the rules that something times out? Is there a timeout param I could set? Thank you! Joseph -- View this message in context: http://drools.46999.n3.nabble.com/Null-Pointer-Exception-with-10K-kBase-objects-tp4027887.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] Null Pointer Exception with 10K+ kBase objects
Here is my test project: DroolsTest.zip http://drools.46999.n3.nabble.com/file/n4027890/DroolsTest.zip Change the TOTAL_OBJECTS member of Main.java to see the impact of having a large number of objects: * If you set it to 1K, everything should work fine. * If you set it to 10K, it will NPE the first time but succeed afterward. * If you set it to 100K, it will NPE every time. Thank you! Joseph Davide Sottara wrote Could you post the full test case (rules + java)? Thanks Davide On 01/28/2014 05:10 PM, jhusby wrote: I'm trying to stress-test Drools to see what its limits are, and I stumbled across a NPE when I have a large amount of facts in a stateful knowledgebase: java.lang.NullPointerException at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuple(PhreakTimerNode.java:355) at org.drools.core.phreak.PhreakTimerNode.doPropagateChildLeftTuples(PhreakTimerNode.java:325) at org.drools.core.phreak.PhreakTimerNode.doNode(PhreakTimerNode.java:72) at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:357) at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:161) at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:116) at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:200) at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:67) at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:935) at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1200) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:957) at org.drools.core.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:931) at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:256) I have a little program that creates, populates, fires, and destroys a session repeatedly. With 10K objects in the knowledge base, I get the NPE the first time I loop through my program, but not subsequently (probably because by the subsequent executions things have been cached). With 100K objects, I get the exception most times. With 1M objects, I get the NPE every time. Am I doing anything wrong or is it simply taking so long to execute all the rules that something times out? Is there a timeout param I could set? Thank you! Joseph -- View this message in context: http://drools.46999.n3.nabble.com/Null-Pointer-Exception-with-10K-kBase-objects-tp4027887p4027890.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] Null Pointer Exception with 10K+ kBase objects
I downloaded your zip file and reproduced the problem you reported (even on master branch). I'll start investigating it in a bit and I'll keep you updated with my findings. Thank you, Mario -- View this message in context: http://drools.46999.n3.nabble.com/Null-Pointer-Exception-with-10K-kBase-objects-tp4027887p4027891.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] Moves Defined from Current State
I'm using Optaplanner 6.0.1 and I'm having trouble defining a type of move that I'd like to define. In my domain, there may be an opportunity to split the value assigned to one entity across two entities. For example: E1=5could become E2=2, E3=3 The trouble is that in some cases this split can be performed more than one way. The above example could also be split to become E2=1,E3=4, ... At the time that the Moves is created (and initialized with entities) by the MoveFactory, there are values assigned to the entities but those values may change and shouldn't be part of the Move (am I right about that?). So when Moves are executed, the values assigned could be considered to create a set of Moves based on the current state but aren't Moves already created long before then? Is there a way to generate moves based on the current state? How do you ensure they are not cached ore reused after that step? Thanks, Jon -- View this message in context: http://drools.46999.n3.nabble.com/Moves-Defined-from-Current-State-tp4027892.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] Drools, slf4j and Eclipse Error on DroolsTest.Java
This isn't my code. It's created when a Drools project is created in Eclipse. I guess that's why this is so frustrating. It's supposed to demonstrate a very simple Drools program and I can't get it to work. It's hard to debug someone else's code when you don't know the language yet. Code is kSession.insert(message); Thanks sdjoe [via Drools] wrote: Hard to say without seeing your code. Can you post it here and point out where the NPE is happening on line 23? If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/Drools-slf4j-and-Eclipse-Error-on-DroolsTest-Java-tp4027853p4027888.html To unsubscribe from Drools, slf4j and Eclipse Error on DroolsTest.Java, click here http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4027853code=dGVycnlAaW5hc3Ryb2wuY29tfDQwMjc4NTN8LTIzMTM3NTI5Nw==. NAML http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml package com.sample; import org.kie.api.KieServices; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; /** * This is a sample class to launch a rule. */ public class DroolsTest { public static final void main(String[] args) { try { // load up the knowledge base KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(ksession-rules); // go ! Message message = new Message(); message.setMessage(Hello World); message.setStatus(Message.HELLO); kSession.insert(message); kSession.fireAllRules(); } catch (Throwable t) { t.printStackTrace(); } } public static class Message { public static final int HELLO = 0; public static final int GOODBYE = 1; private String message; private int status; public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public int getStatus() { return this.status; } public void setStatus(int status) { this.status = status; } } } -- View this message in context: http://drools.46999.n3.nabble.com/Drools-slf4j-and-Eclipse-Error-on-DroolsTest-Java-tp4027853p4027893.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] java dialect and declared types
Are you able to provide a test, for something that produces this? Mark On 28 Jan 2014, at 10:58, pmander paul.s.man...@gmail.com wrote: I've tried to reproduce this in a tester but all my unit tests show 6.0.0 marginally quicker. The rules and data are simplified for the test so I'll try something closer to what i am seeing on the full system. I've just done another comparison and the results are shown in the attached image. http://drools.46999.n3.nabble.com/file/n4027884/Screenshot_2.png There are a number of spikes in the 6.0.1 run that don't help, but it is clear that the 5.5.0 execution is better. I've run the tests several times and all show the same thing. 1st col is average time - 250 jobs to process 2nd col is total time for test to complete - 10 processes executing - 48 core machine 4gb per process - mvel dialect For 5.5.0 5854 215 5707 193 5629 189 5512 183 5607 189 5395 183 5369 183 For 6.0.0 6229 244 5828 219 6076 223 5767 220 5735 220 5821 214 -- View this message in context: http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027884.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] java dialect and declared types
please do pop onto irc and provides us with more details on the performance testing you are doing. We need to add more tests to our test suite, to track any regressions. http://www.jboss.org/drools/irc Mark On 23 Jan 2014, at 15:11, pmander paul.s.man...@gmail.com wrote: Thanks, This was just for a performance test to check mvel against java. Mvel in our case is quicker. The tests also show that 5.5.0 is quicker than 6.0.0. -- View this message in context: http://drools.46999.n3.nabble.com/java-dialect-and-declared-types-tp4027822p4027829.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] permgen error for simple rule stress test
We are running a simple stress test (whose code I will paste below) for a numbercompare rule file) We get the following error before the test finishes. Which seems odd for one rule javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space This test is run against 3 loablanced tomcat servers Here is my JVM_OPTS for each of those tomcat JVM_OPTS=-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m -XX:MaxPermSize=512m -Xss1024K -XX:+UseCodeCacheFlushing -XX:-UseSplitVerifier Here is I have a simple rule file deployed on guvnor on my abc with JVM_OPTS on the guvnor being JVM_OPTS=-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m -XX:MaxPermSize=512m -Xss1024K Here is my stress test that we are running package DroolsTest; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import confident.guppy.tools.Caller; public class DroolsSpeedTest { public static void main(String[] args) { HttpURLConnection httpURLConnection = null; InputStream inputStream = null; BufferedReader bufferedReader = null; long t1 = System.currentTimeMillis(); for (int i = 0; i 1; i++) { try { long start = System.currentTimeMillis(); // Three boxes String url = https://abc-uat2.xyz.com/ces/v2.0/rules/10/compare/10;; httpURLConnection = (HttpURLConnection) ( new URL(url).openConnection()); if (httpURLConnection != null) { inputStream = httpURLConnection.getInputStream(); bufferedReader = new BufferedReader(new InputStreamReader( inputStream)); String results = ; String info = ; while ((info = bufferedReader.readLine()) != null) { results += info; } //caller.log(results); } else { System.out.println(Unable to create the HTTP connection with the required server...); } if (i % 20 == 0 i != 0 ) { System.out.println( passing + i + ms + ( System.currentTimeMillis() - start )); } } catch (Exception boom) { boom.printStackTrace(); System.out.println(It died on the + i + attempt because + boom.getMessage()); } } long t2 = System.currentTimeMillis() - t1 ; System.out.println(I took ms : + t2 ); } } Here is my rules defined on guvnor package org.numbercompare; declare NumberCompare message : String numberone: Integer numbertwo: Integer end rule numberone is equals to numbertwo when n: NumberCompare(numberone == numbertwo); then n.setMessage(numberone is equals to numbertwo); end rule numberone is greater than numbertwo when n: NumberCompare(numberone numbertwo); then n.setMessage(numberone is greater than numbertwo); end rule numberone is less than numbertwo when
[rules-users] kie-workbench external maven repo
Is there a way to setup the kie workbench to point to an internal maven repo to pull internal libraries? -- View this message in context: http://drools.46999.n3.nabble.com/kie-workbench-external-maven-repo-tp4027897.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] Drools 6 and Gradle?
Hello, I keep running into an issue where Drools is looking for a pom.properties file and I get an error since I'm using Gradle. Does Drools depend on Maven? I noticed there is a lot of code looking for Maven and pom.xml and pom.properties, why is that? Thanks! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools 6 and Gradle?
We require jars that are built to conform to maven standards. But they do not need to be built with maven. That means they do need a pom.properties in there. If gradle does not add that automatically, you should be able to automate that yourself. The pom.properties is a very simple file, that requires 3 key value pairs: #Generated by Maven #Wed Nov 18 14:44:09 PST 2009 version=2.2 groupId=javax.el artifactId=el-api This is necessary for discovery of jars, and versioning of jars within the same JVM. Maven provides a standard for this, so it seemed redundant us creating yet another way to declare this meta data. Mark On 28 Jan 2014, at 22:03, Andrew Berman rexx...@gmail.com wrote: Hello, I keep running into an issue where Drools is looking for a pom.properties file and I get an error since I'm using Gradle. Does Drools depend on Maven? I noticed there is a lot of code looking for Maven and pom.xml and pom.properties, why is that? Thanks! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] kie-workbench external maven repo
It obeys the settings.xml file for repository configurations. http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html 4.2.3.5. Settings.xml and Remote Repository Ssetup Mark On 28 Jan 2014, at 21:39, gboro54 gbor...@gmail.com wrote: Is there a way to setup the kie workbench to point to an internal maven repo to pull internal libraries? -- View this message in context: http://drools.46999.n3.nabble.com/kie-workbench-external-maven-repo-tp4027897.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 mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] permgen error for simple rule stress test
permien issus were fixed in the 5.6 release, and 6.0 release, by Davide Sottara. Mark On 28 Jan 2014, at 21:05, anjana.ackroyd anjana.ackr...@gmail.com wrote: We are running a simple stress test (whose code I will paste below) for a numbercompare rule file) We get the following error before the test finishes. Which seems odd for one rule javax.servlet.ServletException: java.lang.OutOfMemoryError: PermGen space This test is run against 3 loablanced tomcat servers Here is my JVM_OPTS for each of those tomcat JVM_OPTS=-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m -XX:MaxPermSize=512m -Xss1024K -XX:+UseCodeCacheFlushing -XX:-UseSplitVerifier Here is I have a simple rule file deployed on guvnor on my abc with JVM_OPTS on the guvnor being JVM_OPTS=-Xms4096m -Xmx4096m -XX:NewSize=2048m -XX:PermSize=512m -XX:MaxPermSize=512m -Xss1024K Here is my stress test that we are running package DroolsTest; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import confident.guppy.tools.Caller; public class DroolsSpeedTest { public static void main(String[] args) { HttpURLConnection httpURLConnection = null; InputStream inputStream = null; BufferedReader bufferedReader = null; long t1 = System.currentTimeMillis(); for (int i = 0; i 1; i++) { try { long start = System.currentTimeMillis(); // Three boxes String url = https://abc-uat2.xyz.com/ces/v2.0/rules/10/compare/10;; httpURLConnection = (HttpURLConnection) ( new URL(url).openConnection()); if (httpURLConnection != null) { inputStream = httpURLConnection.getInputStream(); bufferedReader = new BufferedReader(new InputStreamReader( inputStream)); String results = ; String info = ; while ((info = bufferedReader.readLine()) != null) { results += info; } //caller.log(results); } else { System.out.println(Unable to create the HTTP connection with the required server...); } if (i % 20 == 0 i != 0 ) { System.out.println( passing + i + ms + ( System.currentTimeMillis() - start )); } } catch (Exception boom) { boom.printStackTrace(); System.out.println(It died on the + i + attempt because + boom.getMessage()); } } long t2 = System.currentTimeMillis() - t1 ; System.out.println(I took ms : + t2 ); } } Here is my rules defined on guvnor package org.numbercompare; declare NumberCompare message : String numberone: Integer numbertwo: Integer end rule numberone is equals to numbertwo when n: NumberCompare(numberone == numbertwo); then n.setMessage(numberone is equals to numbertwo); end rule numberone is greater than numbertwo when n: NumberCompare(numberone numbertwo); then n.setMessage(numberone is greater than numbertwo); end rule numberone is less than numbertwo when n: NumberCompare(numberone numbertwo); then n.setMessage(numberone is less than numbertwo); end Here is my code that updates the rule file public KnowledgeBase readKnowledgeBase() throws Exception { ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); ResourceChangeScannerConfiguration sconf = ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); sconf.setProperty(drools.resource.scanner.interval, 2); ResourceFactory.getResourceChangeScannerService().configure(sconf); KnowledgeAgentConfiguration kaconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration(); kaconf.setProperty(drools.agent.scanDirectories, true); kaconf.setProperty(drools.agent.scanResources, true); kaconf.setProperty(drools.agent.newInstance, false); KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(CS, kaconf);
[rules-users] ReteOO, KnowledgeBase and KnowledgeSession relation
Hi, I understand that the ReteOO network is built when a KnowledgeBase is created. Can you please tell me: - if any modifications are made to this network after a session (say StatefulKnowledgeSession) has been created from this KnowledgeBase? - any optimizations made at the session level? (such that time taken to fire rules decreases when certain set of facts are re-inserted and rules re-executed) I could not find any explanation in Drools Expert documentation regarding the above two points. Any pointers explaining the relation between ReteOO, KnowledgeBase and KnowledgeSession will be helpful. Thanks. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools, slf4j and Eclipse Error on DroolsTest.Java
Figured out the problem. Didn't have Maven installed as a plug-in correctly. The book I'm using to learn Drools, didn't include that step. Terry Moriarty wrote: This isn't my code. It's created when a Drools project is created in Eclipse. I guess that's why this is so frustrating. It's supposed to demonstrate a very simple Drools program and I can't get it to work. It's hard to debug someone else's code when you don't know the language yet. Code is kSession.insert(message); Thanks sdjoe [via Drools] wrote: Hard to say without seeing your code. Can you post it here and point out where the NPE is happening on line 23? If you reply to this email, your message will be added to the discussion below: http://drools.46999.n3.nabble.com/Drools-slf4j-and-Eclipse-Error-on-DroolsTest-Java-tp4027853p4027888.html To unsubscribe from Drools, slf4j and Eclipse Error on DroolsTest.Java, click here http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4027853code=dGVycnlAaW5hc3Ryb2wuY29tfDQwMjc4NTN8LTIzMTM3NTI5Nw==. NAML http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml package com.sample; import org.kie.api.KieServices; import org.kie.api.runtime.KieContainer; import org.kie.api.runtime.KieSession; /** * This is a sample class to launch a rule. */ public class DroolsTest { public static final void main(String[] args) { try { // load up the knowledge base KieServices ks = KieServices.Factory.get(); KieContainer kContainer = ks.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(ksession-rules); // go ! Message message = new Message(); message.setMessage(Hello World); message.setStatus(Message.HELLO); kSession.insert(message); kSession.fireAllRules(); } catch (Throwable t) { t.printStackTrace(); } } public static class Message { public static final int HELLO = 0; public static final int GOODBYE = 1; private String message; private int status; public String getMessage() { return this.message; } public void setMessage(String message) { this.message = message; } public int getStatus() { return this.status; } public void setStatus(int status) { this.status = status; } } } -- View this message in context: http://drools.46999.n3.nabble.com/Drools-slf4j-and-Eclipse-Error-on-DroolsTest-Java-tp4027853p4027904.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] ReteOO, KnowledgeBase and KnowledgeSession relation
On 29 Jan 2014, at 00:50, Harpreet Singh harpreet2...@yahoo.com wrote: Hi, I understand that the ReteOO network is built when a KnowledgeBase is created. Can you please tell me: - if any modifications are made to this network after a session (say StatefulKnowledgeSession) has been created from this KnowledgeBase? Not unless you add or remove rules. - any optimizations made at the session level? (such that time taken to fire rules decreases when certain set of facts are re-inserted and rules re-executed) no, not if you have to re-insert all data. I could not find any explanation in Drools Expert documentation regarding the above two points. Any pointers explaining the relation between ReteOO, KnowledgeBase and KnowledgeSession will be helpful. Thanks. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Drools 6 and Gradle?
Great, thanks Mark! On Tue, Jan 28, 2014 at 4:06 PM, Mark Proctor mproc...@codehaus.org wrote: We require jars that are built to conform to maven standards. But they do not need to be built with maven. That means they do need a pom.properties in there. If gradle does not add that automatically, you should be able to automate that yourself. The pom.properties is a very simple file, that requires 3 key value pairs: *#Generated by Maven **#Wed Nov 18 14:44:09 PST 2009 **version*=*2.2 **groupId*=*javax.el **artifactId*=*el-api * This is necessary for discovery of jars, and versioning of jars within the same JVM. Maven provides a standard for this, so it seemed redundant us creating yet another way to declare this meta data. Mark On 28 Jan 2014, at 22:03, Andrew Berman rexx...@gmail.com wrote: Hello, I keep running into an issue where Drools is looking for a pom.properties file and I get an error since I'm using Gradle. Does Drools depend on Maven? I noticed there is a lot of code looking for Maven and pom.xml and pom.properties, why is that? Thanks! ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users