If it works OK when ran as a standalone Java application but not when deployed on a server I suspect the problem is that your ChangeSet.xml cannot be found.<br><br>A stack trace would be helpful.<br><br><div class="gmail_quote">
On 18 February 2013 20:00, anikulin <span dir="ltr">&lt;<a href="mailto:antonnik94@gmail.com" target="_blank">antonnik94@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
I&#39;ve configurated KnowledgeAgent like this and it was working with PKG files<br>
from guvnor, but when i changed path and type of recources to DRL when i<br>
trying to run it on server i have such warning in logs and KnowledgeBase is<br>
empty and no rules are fired:<br>
<br>
KnowledgeAgent: impossible to add a map for a null resource! skiping.<br>
<br>
                 KnowledgeBase kbase =<br>
KnowledgeBaseFactory.newKnowledgeBase();<br>
<br>
                 ResourceChangeScannerConfiguration sconf = ResourceFactory<br>
                 .getResourceChangeScannerService()<br>
                 .newResourceChangeScannerConfiguration();<br>
                 sconf.setProperty(&quot;drools.resource.scanner.interval&quot;,<br>
                 scannerInterval);<br>
                 ResourceFactory.getResourceChangeScannerService().configure(sconf);<br>
<br>
                 KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory<br>
                 .newKnowledgeAgentConfiguration();<br>
                 aconf.setProperty(&quot;drools.agent.scanDirectories&quot;, &quot;true&quot;);<br>
                 aconf.setProperty(&quot;drools.agent.scanResources&quot;, &quot;true&quot;);<br>
                 aconf.setProperty(&quot;drools.agent.newInstance&quot;, &quot;true&quot;);<br>
                 kagent = KnowledgeAgentFactory.newKnowledgeAgent(&quot;changeSetAgent&quot;,<br>
                 kbase, aconf);<br>
                 kagent.applyChangeSet(ResourceFactory<br>
                 .newClassPathResource(&quot;ChangeSet.xml&quot;));<br>
<br>
But this warn I have only with server deploying, when i run this program<br>
just as standalone java program everythink is ok and rules are firing.<br>
<br>
My ChangeSet.xml looks like this:<br>
<br>
&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;<br>
        xmlns:xs=&#39;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&#39;<br>
        xs:schemaLocation=&#39;<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a><br>
<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;<br>

        &lt;add&gt;<br>
                &lt;resource<br>
                        source=&#39;<a href="http://localhost:8083/drools-guvnor/rest/packages/magick/source" target="_blank">http://localhost:8083/drools-guvnor/rest/packages/magick/source</a>&#39;<br>
                        type=&#39;DRL&#39; basicAuthentication=&quot;enabled&quot; username=&quot;admin&quot;<br>
password=&quot;admin&quot; /&gt;<br>
        &lt;/add&gt;<br>
&lt;/change-set&gt;<br>
<br>
<br>
P.S. I have to change PKG type to DRL, cause drools ignore calendars clause<br>
in compiled rules from guvnor.<br>
<br>
Can you help me to solve this problem?<br>
<br>
Thanks, Anton<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/KnowledgeAgent-impossible-to-add-a-map-for-a-null-resource-skiping-tp4022425.html" target="_blank">http://drools.46999.n3.nabble.com/KnowledgeAgent-impossible-to-add-a-map-for-a-null-resource-skiping-tp4022425.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></div><br>