[jboss-user] [jBPM] - NPE Loading Knowledge Base from URL

M Arnold do-not-reply at jboss.com
Mon Jan 9 13:47:28 EST 2012


M Arnold [http://community.jboss.org/people/marnold] created the discussion

"NPE Loading Knowledge Base from URL"

To view the discussion, visit: http://community.jboss.org/message/645516#645516

--------------------------------------------------------------
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
[http://community.jboss.org/message/645516#645516]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120109/f2eb9a0b/attachment-0001.html 


More information about the jboss-user mailing list