|
Dear All,
I have an application that use Guvnor 5.4.0 final as the rules repository and a DroolsServer 5.4.0 final (with Spring Camel) to provide rule engine via a Rest Webservices, all of those apps Running in a JBossAS 7.1.
All of the service are working perfectly, except the resource-change-scanner that is configured in the knowledge-services.xml [1] as it's described in the documentation. When Drools-Server are deployed the Change Scanner does not start (I'm monitoring the change scanner via Wireshark analyzing the communication between DroolServer and Guvnor), I've created an small JSP file [2] that invoke the ChangeScanner start method, when i run the JSP the Change Scanner start to work (i can see the http requests from Drools Server do Guvnor to see if the knowledge base had changed), but after Change Scanner started working the rules are not triggered anymore.
So without Change Scanner I've all of the knowledge service running properly, but the App is unable to detect rules changes, when I explicitly (via JSP) start the Change Scanner all of the knowledge service stopped working.
Change Scanner starts automatically? Does anybody has some idea to help me? [1] ------------------------------------------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:drools="http://drools.org/schema/drools-spring" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
<drools:grid-node id="node1"/> <drools:resource-change-scanner id="scanner" interval="10" /> <drools:kbase id="kbase1" node="node1" />
<drools:kagent id="kagent1" kbase="kbase1"> <drools:resources> <drools:resource type="CHANGE_SET" source="classpath:ChangeSet.xml" />
</drools:resources> </drools:kagent> <drools:ksession id="ksession1" type="stateless" kbase="kbase1" node="node1"/> </beans>
[2] ------------------------------------------------------------------------ <%@ page language="java" contentType="text/html; charset=utf-8" %>
<% org.drools.io.ResourceChangeScannerConfiguration sconf = org.drools.io.ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration(); sconf.setProperty("drools.resource.scanner.interval", "5");
org.drools.io.ResourceFactory.getResourceChangeScannerService().configure(sconf); org.drools.io.ResourceFactory.getResourceChangeScannerService().start(); org.drools.io.ResourceFactory.getResourceChangeNotifierService().start();
%> Best Regards,
_______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
This post has NOT been accepted by the mailing list yet.
Let me know if this helps...........
add the enabled="true" attribute to the resource-change-scanner element <drools:resource-change-scanner id="scanner" interval="10" enabled="true"/> |
|
In reply to this post by Antonio Anderson Souza-2
Dear All,
I discovered why the rules stopped working after ChangeScanner starts the problem is the issue JBRULES-2947.
To fix the problem I changed my models to a POJO package instead of the Described in the Guvnor (the solution was found in this thread http://drools.46999.n3.nabble.com/drools-server-resource-change-scanner-notifier-td2649325.html), after that when I start the Change Scanner by the jsp DroolsServer detects changes in the rules stored in Guvnor, and fire all rules properly.
The unique problem that persists is the Change Scanner start that i need to call it in the JSP mannually, I'll automate in the the application start. Best Regards, Antonio Anderson Souza Blog - Twitter - LinkedIn - Facebook On Wed, Jul 11, 2012 at 7:53 PM, Antonio Anderson Souza <[hidden email]> wrote: Dear All, _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
Thanks Vinodkiran,
Your answer(http://drools.46999.n3.nabble.com/rules-users-Change-Scanner-does-not-start-td4018607.html) fixed the Change Scanner problem, just put the enabled="true" and the Change Scanner started working.
For some reason your answer was not accepted in the mailing list, so i discovered that somebody had answer my post only today googling about the problem again. Thank you very much!
Antonio Anderson Souza Blog - Twitter - LinkedIn - Facebook On Thu, Jul 12, 2012 at 4:14 PM, Antonio Anderson Souza <[hidden email]> wrote: Dear All, _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
|
In reply to this post by Antonio Anderson Souza-2
Hi all,
I have a similar setup as Antonio (guvnor 5.4.0.Final and drools-server 5.4.0.Final on JBoss AS 7.1.1.Final running on the same machine). Drools-Server is able to get the rules package from guvnor at startup, but I cannot get the resource change scanner to start. My knowledge-services.xml has this entry <drools:resource-change-scanner id="scanner" interval="5" enabled="true"/> I used the jsp suggested by Antonio to invoke the change scanner, but drools-server does not detect any changes. Hi Antonio, I named the jsp as start-scanner-service.jsp, and executed it from the browser - http://localhost:8080/drools-server/start-scanner-service.jsp. Am I supposed to see something in the log file to indicate that the scanner has started? There is absolutley no entry or error in the log file when I execute the jsp. Thanks, Ramgopal Tanikella |
|
The scanner does start, but it is not logged automatically. I started a listener via a jsp
<%@ page language="java" contentType="text/html; charset=utf-8" %> <% org.drools.SystemEventListenerFactory.setSystemEventListener(new org.drools.agent.impl.PrintStreamSystemEventListener(System.out)); %> and then I could see the logs. As Antonio pointed out, a) make sure that your changset resources include only POJOs, and NOT declared facts, and b) knowledge-services.xml has this entry - the attribute "enabled" set to true being the key here, to start the scanner. <drools:resource-change-scanner id="scanner" interval="60" enabled="true"/> This also means that you don't need Antonio's JSP to start the scanner. It may however come in handy if you need to change the scan interval. |
|
A ServletContextListener might be preferable to using a JSP. sent on the move On 18 Jan 2013 19:17, "rtanikella" <[hidden email]> wrote: The scanner does start, but it is not logged automatically. I started a _______________________________________________ rules-users mailing list [hidden email] https://lists.jboss.org/mailman/listinfo/rules-users |
| Powered by Nabble | Edit this page |
