JBoss Community

NPE Loading Knowledge Base from URL

created by M Arnold in jBPM - View the full discussion

Hi,

 

I'm using Drools and Guvnor 5.3.1.  When I try to load my knowledge base from Guvnor like this:

{code}

   KnowledgeAgentConfiguration kaconf = KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

             kaconf.setProperty("drools.agent.scanDirectories", "false");

             kaconf.setProperty("drools.agent.scanResources", "false");

 

             KnowledgeAgent ka = KnowledgeAgentFactory.newKnowledgeAgent("agent", kaconf);

 

             URL url = new URL(urlString);

             UrlResource urlResource = (UrlResource)ResourceFactory.newUrlResource(url);

             ka.applyChangeSet(urlResource);

             kbase = ka.getKnowledgeBase();

{code}

 

I get this exception:

 

{code}

java.lang.NullPointerException

        at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:148)

        at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1016)

        at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:785)

        at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:657)

        at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:190)

        at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:169)

[snip]

{code}

 

I've tried 'Rebuilding all snapshot binaries'.  Has my repository become corrupted?

 

Also, can I build my knowledge base directly from Guvnor's JCR implementation, rather than over HTTP?  I'm not interested in listening / scanning for changes to the underlying packages.  I just want to load my rules and processes from Guvnor.

 

Apologies if this is not the correct forum.  I couldn't find a discussion forum for Drools.

 

Thanks

Reply to this message by going to Community

Start a new discussion in jBPM at Community