Re: [rules-users] KnowledgeAgent and Guvnor restart
Sorry for bringing this up again. We have exactly the same problem. I believe i have read something about a property that can be set, which lets the knowledge-base survive, even if the guvnor is down. Can anyone help how to achieve this? Any Ideas? Thanks in advance, Dirk -- View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-and-Guvnor-restart-tp139364p2815253.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] KnowledgeAgent and Guvnor restart
Please, read the section called 2.3.2.3. Remote HTTP resource caching in drools-expert documentation: http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e918 You could try setting the system property it mentions. Best Regards, http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e918 Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com On Wed, Apr 13, 2011 at 5:55 AM, dhermanns d.herma...@lvm.de wrote: Sorry for bringing this up again. We have exactly the same problem. I believe i have read something about a property that can be set, which lets the knowledge-base survive, even if the guvnor is down. Can anyone help how to achieve this? Any Ideas? Thanks in advance, Dirk -- View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-and-Guvnor-restart-tp139364p2815253.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] KnowledgeAgent and Guvnor restart
Thank you, Esteban, this is working for me. Also, with Drools 5.1.1 the KnowledgeAgent is resubscribing to Guvnor after shutdown/restart even without the disk cache. Best Regards, Gerret -- View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-and-Guvnor-restart-tp139364p2816256.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] KnowledgeAgent and Guvnor restart
Hello, I have similar issues. Basically, KnowledgeAgent is connected to Guvnor and running merrily along the way, then Guvnor drop and the rules no longer runs. When we bring back up Guvnor, KowledgeAgent does not recognize that Guvnor is back up and the rules remain not running correctly. Is there any build into the product ways to cache rules with the KnowledgeAgent? I know with the older rule base API, there is a RuleAgent and we can specify a cache directory in RuleAgent.properties file to cache rules. But with the newer knowledge base API, this functionality seems to be gone from KowledgeAgent. thanks! Wing Tang -- View this message in context: http://n3.nabble.com/KnowledgeAgent-and-Guvnor-restart-tp139364p185497.html 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
[rules-users] KnowledgeAgent and Guvnor restart
Hello, I have got an issue with the KnowledgeAgent that seems not to survive a Guvnor restart. The scenario is as follows: * We use Drools 5.0 * On our application server we create a KnowledgeAgent applying a ChangeSet that points to a package binary on a separate Guvnor server like so: SystemEventListenerFactory.setSystemEventListener(new SystemEventLogger()); ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); KnowledgeAgent agent = KnowledgeAgentFactory.newKnowledgeAgent(workflowName); agent.applyChangeSet(changeSet); * Creating the kbase, registering globals and running sessions works fine. * We shut down Guvnor (or the connection goes down, this was how we spotted the problem) and restart it after a minute * We then try to run sessions from the same agent as above via kagent.getKnowledgeBase().newStatefulKnowledgeSession(); which returns a ksession, but then setting a global we get java.lang.RuntimeException: Unexpected global [log] at org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:5 50) at org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessio nImpl.java:284) From the debugger I can see that indeed the ruleBase's globals map is empty. The SystemEventLogger indicates that the KnowledgeAgent unsubscribes from its resource when Guvnor is down and rebuilds its kbase. Also, it stops scanning the resource and does not find it once Guvnor is up again. (See log snippet below). Wouldn't it be better in these cases to keep the resource as is in memory and try to rescan? I figure that as long as the resource is specified in the changeSet it should be considered part of the kbase and not be removed if it cannot be found. For the time being, does anyone have a suggestion how to avoid these problems? We could catch the RuntimeException and recreate the KnowledgeAgent, but perhaps there is a better way? Thanks, Gerret -- SystemEventLog -- # Guvnor is up here 07:58:01,881 ResourceChangeScanner attempt to scan 1 resources 07:58:02,209 ResourceChangeScanner thread is waiting for 60 07:58:15,067 ResourceChangeScanner attempt to scan 1 resources # Guvnor goes down here 07:58:16,738 ResourceChangeScanner removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification received ChangeSet notification 07:58:16,738 ResourceChangeScanner thread is waiting for 60 07:58:16,738 ResourceChangeNotification processing ChangeSet 07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for listener=org.drools.agent.impl.knowledgeagenti...@1053d6d 07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for listener=org.drools.agent.impl.knowledgeagenti...@b71c17 07:58:16,738 KnowledgeAgent received ChangeSet changed notification 07:58:16,738 KnowledgeAgent received ChangeSet changed notification 07:58:16,738 KnowledgAgent applying ChangeSet 07:58:16,738 ResourceChangeNotification thread is waiting for queue update 07:58:16,738 KnowledgAgent applying ChangeSet 07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification unsubscribing listener=org.drools.agent.impl.knowledgeagenti...@1053d6d to resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 KnowledgeAgent rebuilding KnowledgeBase using ChangeSet 07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification unsubscribing listener=org.drools.agent.impl.knowledgeagenti...@b71c17 to resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 KnowledgeAgent rebuilding KnowledgeBase using ChangeSet 07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use 07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use 07:59:02,202 ResourceChangeScanner attempt to scan 0 resources 07:59:02,202 ResourceChangeScanner thread is waiting for 60 # Guvnor back up here 07:59:16,731 ResourceChangeScanner attempt to scan 0 resources 07:59:16,731 ResourceChangeScanner thread is waiting for 60 ___ rules-users mailing list rules-users@lists.jboss.org
[rules-users] KnowledgeAgent and Guvnor restart
Hello, I have got an issue with the KnowledgeAgent that seems not to survive a Guvnor restart. The scenario is as follows: * We use Drools 5.0 * On our application server we create a KnowledgeAgent applying a ChangeSet that points to a package binary on a separate Guvnor server like so: SystemEventListenerFactory.setSystemEventListener(new SystemEventLogger()); ResourceFactory.getResourceChangeNotifierService().start(); ResourceFactory.getResourceChangeScannerService().start(); KnowledgeAgent agent = KnowledgeAgentFactory.newKnowledgeAgent(workflowName); agent.applyChangeSet(changeSet); * Creating the kbase, registering globals and running sessions works fine. * We shut down Guvnor (or the connection goes down, this was how we spotted the problem) and restart it after a minute * We then try to run sessions from the same agent as above via kagent.getKnowledgeBase().newStatefulKnowledgeSession(); which returns a ksession, but then setting a global we get java.lang.RuntimeException: Unexpected global [log] at org.drools.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:5 50) at org.drools.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessio nImpl.java:284) From the debugger I can see that indeed the ruleBase's globals map is empty. The SystemEventLogger indicates that the KnowledgeAgent unsubscribes from its resource when Guvnor is down and rebuilds its kbase. Also, it stops scanning the resource and does not find it once Guvnor is up again. (See log snippet below). Wouldn't it be better in these cases to keep the resource as is in memory and try to rescan? I figure that as long as the resource is specified in the changeSet it should be considered part of the kbase and not be removed if it cannot be found. For the time being, does anyone have a suggestion how to avoid these problems? We could catch the RuntimeException and recreate the KnowledgeAgent, but perhaps there is a better way? Thanks, Gerret -- SystemEventLog -- # Guvnor is up here 07:58:01,881 ResourceChangeScanner attempt to scan 1 resources 07:58:02,209 ResourceChangeScanner thread is waiting for 60 07:58:15,067 ResourceChangeScanner attempt to scan 1 resources # Guvnor goes down here 07:58:16,738 ResourceChangeScanner removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification received ChangeSet notification 07:58:16,738 ResourceChangeScanner thread is waiting for 60 07:58:16,738 ResourceChangeNotification processing ChangeSet 07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for listener=org.drools.agent.impl.knowledgeagenti...@1053d6d 07:58:16,738 ResourceChangeNotification ChangeSet removed resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] for listener=org.drools.agent.impl.knowledgeagenti...@b71c17 07:58:16,738 KnowledgeAgent received ChangeSet changed notification 07:58:16,738 KnowledgeAgent received ChangeSet changed notification 07:58:16,738 KnowledgAgent applying ChangeSet 07:58:16,738 ResourceChangeNotification thread is waiting for queue update 07:58:16,738 KnowledgAgent applying ChangeSet 07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification unsubscribing listener=org.drools.agent.impl.knowledgeagenti...@1053d6d to resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 KnowledgeAgent rebuilding KnowledgeBase using ChangeSet 07:58:16,738 KnowledgeAgent unsubscribing from resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 ResourceChangeNotification unsubscribing listener=org.drools.agent.impl.knowledgeagenti...@b71c17 to resource=[UrlResource path='http://localhost:7080/drools- guvnor/org.drools.guvnor.Guvnor/package/com.foo.bar/LATEST'] 07:58:16,738 KnowledgeAgent rebuilding KnowledgeBase using ChangeSet 07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use 07:58:16,738 KnowledgeAgent new KnowledgeBase now built and in use 07:59:02,202 ResourceChangeScanner attempt to scan 0 resources 07:59:02,202 ResourceChangeScanner thread is waiting for 60 # Guvnor back up here 07:59:16,731 ResourceChangeScanner attempt to scan 0 resources 07:59:16,731 ResourceChangeScanner thread is waiting for 60 -- Nur noch bis 31.01.2010: DSL-Komplettpaket für 16,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02