So, maybe some change in PackageBuilder is not setting the correct Resource to Declared Fact types. Unfortunately I don&#39;t have time right now to take a look at this problem. <div>Could you try adding DRL resource instead of compiled package? <br>

<div><br></div><div>Best Regards, <br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>


<br><br><div class="gmail_quote">2012/1/17 Dean Eastwood <span dir="ltr">&lt;<a href="mailto:dean@qualica.com">dean@qualica.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Esteban<div><br></div><div>Unfortunately I haven&#39;t had time to work further on this issue, so I don&#39;t have an answer yet.</div><div><br></div><div>All I can say for now is it seems that the ReaderResources are being created along with the URLResource each time. This is evidenced by the details below.</div>


<div><br></div><div>In my test, I have the following changeset based on the mortgages sample (I have changed my hosting port):</div><div><br></div><div>----------------------------------------------------------------------------------------------</div>


<div><br></div><div><div><b>&lt;change-set xmlns=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>&#39;</b></div><div><b>    xmlns:xs=&#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;</b></div>


<div><b>    xs:schemaLocation=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a> <a href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd" target="_blank">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd</a>&#39; &gt;</b></div>


<div><b>    &lt;add&gt;</b></div><div><b>         &lt;resource source=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39; type=&#39;PKG&#39; /&gt;</b></div>


<div><b>    &lt;/add&gt;</b></div><div><b>&lt;/change-set&gt;</b></div></div><div><br></div><div>----------------------------------------------------------------------------------------------
</div><div><br></div><div>This changeset can be read as a UrlResource, ClassPathResource or ByteArrayResource. I then use the following code to initialise the KnowledgeAgent:</div><div><br></div><div>----------------------------------------------------------------------------------------------
</div><div><br></div><div><div><b>SystemEventListenerFactory.setSystemEventListener(new PrintStreamSystemEventListener(System.out));</b></div><div><b>        <span style="white-space:pre-wrap">        </span></b></div>
<div><b>KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(&quot;MortgageAgent&quot;);</b></div><div><b>Resource changeset = ResourceFactory.newClassPathResource(&quot;ChangeSet.xml&quot;);</b></div><div><b>kagent.applyChangeSet(changeset);</b></div>


</div><div><br></div><div>----------------------------------------------------------------------------------------------
</div><div><br></div><div>Within the System event listener output, I see that the KnowledgeAgent picks up all of the KnowledgeDefinitions from Drools and creates them as new UrlResources. Next, it picks up the KnowledgeDefinitions from drools and creates these all as null ReaderResources. Here is some output from my System event listener:</div>


<div><br></div><div>----------------------------------------------------------------------------------------------
</div><div><div><br></div><div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:32,577:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet</b></div><div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,410:debug] KnowledgeAgent building resource map</b></div>

<div>
<b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent no resource mapped for rule=[Rule name=Dummy rule, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>

<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Dummy rule, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Underage, agendaGroup=MAIN, salience=10, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Bankruptcy history, agendaGroup=MAIN, salience=10, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=No bad credit checks, agendaGroup=MAIN, salience=10, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=no NINJAs, agendaGroup=MAIN, salience=10, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Row 3 Pricing loans, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Row 1 Pricing loans, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=Row 2 Pricing loans, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=CreditApproval, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=DateDslRule, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,411:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=CheckBoxDslRule, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent mapping resource=[UrlResource path=&#39;<a href="http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST" target="_blank">http://localhost:8090/guvnor/org.drools.guvnor.Guvnor/package/mortgages/LATEST</a>&#39;] to KnowledgeDefinition=[Rule name=RegexDslRule, agendaGroup=MAIN, salience=0, no-loop=false]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent mapping resource=[ReaderResource resource=null encoding=&#39;null&#39;] to KnowledgeDefinition=org.drools.rule.TypeDeclaration@b10723b8</b></div>

<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent notifier subscribing to resource=[ReaderResource resource=null encoding=&#39;null&#39;]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] ResourceChangeNotification subscribing listener=org.drools.agent.impl.KnowledgeAgentImpl@54b216b3 to resource=[ReaderResource resource=null encoding=&#39;null&#39;]</b></div>

<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] ResourceChangeScanner subcribing notifier=org.drools.io.impl.ResourceChangeNotifierImpl@77f06d35 to resource=[ReaderResource resource=null encoding=&#39;null&#39;]</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent mapping resource=[ReaderResource resource=null encoding=&#39;null&#39;] to KnowledgeDefinition=org.drools.rule.TypeDeclaration@a562a3f</b></div>

<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent mapping resource=[ReaderResource resource=null encoding=&#39;null&#39;] to KnowledgeDefinition=org.drools.rule.TypeDeclaration@9baaa763</b></div>


<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent mapping resource=[ReaderResource resource=null encoding=&#39;null&#39;] to KnowledgeDefinition=org.drools.rule.TypeDeclaration@fadf3f01</b></div>

<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:info] KnowledgeAgent new KnowledgeBase now built and in use</b></div>
<div><b><a href="tel:%5B2012-01-17%2010" value="+12012011710" target="_blank">[2012-01-17 10</a>:32:33,412:debug] KnowledgeAgent finished rebuilding KnowledgeBase using ChangeSet</b></div></div><div><br></div><div>----------------------------------------------------------------------------------------------
</div><div><br></div><div>As a result of these ReaderResources existing, the ResourceChangeScanner cannot run as the ReaderResources do not have a modified date.</div><div><br></div><div>At the moment I am not sure why these ReaderResources are created but I would imagine they are there to represent the drools domain facts. There are four facts in the mortgages sample and four ReaderResources are created.</div>


<div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Dean</div></font></span><div class="HOEnZb"><div class="h5"><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">

2012/1/17 Esteban Aliverti <span dir="ltr">&lt;<a href="mailto:esteban.aliverti@gmail.com" target="_blank">esteban.aliverti@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dean, did you figure out why your code is using a ReaderResource? There are other threads reporting this same problem.<div>


<br></div><div><div>Best Regards,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>

- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br></div><div>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>

<br><br></div><div><div><div class="gmail_quote">On Fri, Jan 6, 2012 at 2:14 PM, Jiri Svitak <span dir="ltr">&lt;<a href="mailto:jsvitak@redhat.com" target="_blank">jsvitak@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hello Dean,<br>
<br>
you are right,<br>
<a href="https://issues.jboss.org/browse/GUVNOR-1699" target="_blank">https://issues.jboss.org/browse/GUVNOR-1699</a><br>
solves something different. Bugzilla<br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=733008" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=733008</a><br>
still waits to be solved. I have updated this bugzilla to be linked to<br>
belonging JIRA issues.<br>
You can look also on other bugs which have the same root cause. But I am<br>
not developer, so I cannot<br>
tell you when it&#39;ll be fixed.<br>
<span><font color="#888888"><br>
Jiri Svitak<br>
</font></span><div><div><br>
On 01/05/2012 02:27 PM, Dean wrote:<br>
&gt; Hi<br>
&gt;<br>
&gt; I am experiencing a problem with starting the ResourceChangeScannerService<br>
&gt; as described here: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=733008" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=733008</a><br>
&gt;<br>
&gt; I can create a KnowledgeAgent instance and apply a changeset to it which<br>
&gt; loads the desired package from Guvnor. However, as soon as I attempt to<br>
&gt; start the ScannerService in order to be notified of changes to this package<br>
&gt; I immediately receive the exception: java.lang.IllegalStateException: reader<br>
&gt; does have a modified date. Then on every scanner interval following, the<br>
&gt; scanner fails each time with the same error message.<br>
&gt;<br>
&gt; Apparently, this issue has already been fixed here:<br>
&gt; <a href="https://issues.jboss.org/browse/GUVNOR-1699" target="_blank">https://issues.jboss.org/browse/GUVNOR-1699</a><br>
&gt;<br>
&gt; However, I am still experiencing this problem even with Drools 5.4.0.Beta1<br>
&gt;<br>
&gt; Could somebody perhaps help me with this. I am attempting to rebuild the<br>
&gt; source code on my side, however, I am having endless problems with Maven.<br>
&gt;<br>
&gt; Regards<br>
&gt;<br>
&gt; Dean<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3634802.html" target="_blank">http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3634802.html</a><br>





&gt; Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div></div>