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"><<a href="mailto:antonnik94@gmail.com" target="_blank">antonnik94@gmail.com</a>></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'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("drools.resource.scanner.interval",<br>
scannerInterval);<br>
ResourceFactory.getResourceChangeScannerService().configure(sconf);<br>
<br>
KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory<br>
.newKnowledgeAgentConfiguration();<br>
aconf.setProperty("drools.agent.scanDirectories", "true");<br>
aconf.setProperty("drools.agent.scanResources", "true");<br>
aconf.setProperty("drools.agent.newInstance", "true");<br>
kagent = KnowledgeAgentFactory.newKnowledgeAgent("changeSetAgent",<br>
kbase, aconf);<br>
kagent.applyChangeSet(ResourceFactory<br>
.newClassPathResource("ChangeSet.xml"));<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>
<change-set xmlns='<a href="http://drools.org/drools-5.0/change-set" target="_blank">http://drools.org/drools-5.0/change-set</a>'<br>
xmlns:xs='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'<br>
xs:schemaLocation='<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>'><br>
<add><br>
<resource<br>
source='<a href="http://localhost:8083/drools-guvnor/rest/packages/magick/source" target="_blank">http://localhost:8083/drools-guvnor/rest/packages/magick/source</a>'<br>
type='DRL' basicAuthentication="enabled" username="admin"<br>
password="admin" /><br>
</add><br>
</change-set><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>