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.

A stack trace would be helpful.

On 18 February 2013 20:00, anikulin <antonnik94@gmail.com> wrote:
Hi

I've configurated KnowledgeAgent like this and it was working with PKG files
from guvnor, but when i changed path and type of recources to DRL when i
trying to run it on server i have such warning in logs and KnowledgeBase is
empty and no rules are fired:

KnowledgeAgent: impossible to add a map for a null resource! skiping.

                 KnowledgeBase kbase =
KnowledgeBaseFactory.newKnowledgeBase();

                 ResourceChangeScannerConfiguration sconf = ResourceFactory
                 .getResourceChangeScannerService()
                 .newResourceChangeScannerConfiguration();
                 sconf.setProperty("drools.resource.scanner.interval",
                 scannerInterval);
                 ResourceFactory.getResourceChangeScannerService().configure(sconf);

                 KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
                 .newKnowledgeAgentConfiguration();
                 aconf.setProperty("drools.agent.scanDirectories", "true");
                 aconf.setProperty("drools.agent.scanResources", "true");
                 aconf.setProperty("drools.agent.newInstance", "true");
                 kagent = KnowledgeAgentFactory.newKnowledgeAgent("changeSetAgent",
                 kbase, aconf);
                 kagent.applyChangeSet(ResourceFactory
                 .newClassPathResource("ChangeSet.xml"));

But this warn I have only with server deploying, when i run this program
just as standalone java program everythink is ok and rules are firing.

My ChangeSet.xml looks like this:

<change-set xmlns='http://drools.org/drools-5.0/change-set'
        xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
        xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd'>
        <add>
                <resource
                        source='http://localhost:8083/drools-guvnor/rest/packages/magick/source'
                        type='DRL' basicAuthentication="enabled" username="admin"
password="admin" />
        </add>
</change-set>


P.S. I have to change PKG type to DRL, cause drools ignore calendars clause
in compiled rules from guvnor.

Can you help me to solve this problem?

Thanks, Anton



--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeAgent-impossible-to-add-a-map-for-a-null-resource-skiping-tp4022425.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